diff --git a/react/dynamic-nested-rows/src/DynamicNestedRows.tsx b/react/dynamic-nested-rows/src/DynamicNestedRows.tsx index 3eb6eed..c7ff0b1 100644 --- a/react/dynamic-nested-rows/src/DynamicNestedRows.tsx +++ b/react/dynamic-nested-rows/src/DynamicNestedRows.tsx @@ -8,12 +8,7 @@ import { ColumnDef, flexRender, } from '@tanstack/react-table'; -import { - DataTable, - TableContainer, - Button, - InlineLoading, -} from '@carbon/react'; +import { DataTable, TableContainer, Button, SkeletonText } from '@carbon/react'; import { ChevronRight } from '@carbon/react/icons'; const { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } = DataTable; @@ -26,18 +21,17 @@ import * as packageJson from '../package.json'; export const DynamicNestedRows = () => { const [data, setData] = React.useState(() => makeData(5)); const [rowsFetchingList, setRowsFetchingList] = useState([]); - console.log(data); const columns = React.useMemo[]>( () => [ { accessorKey: 'name', - header: ({ table }) =>
Name
, + header: () =>
Name
, cell: ({ row, getValue }) => { const foundManualSubRowCheck = typeof table?.options?.meta?.checkSubRows === 'function'; - const foundLoadingRow = !!rowsFetchingList.find( - (a) => a.id === row.id - ); + const foundLoadingRow = !!rowsFetchingList.filter( + (r) => r.id === row.id + ).length; return (
{