Skip to content

Commit

Permalink
[filigran-ui] fix warning key on loading row
Browse files Browse the repository at this point in the history
  • Loading branch information
jpkha committed Jul 11, 2024
1 parent a46d709 commit 80f2d6c
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions packages/filigran-ui/src/components/clients/data-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,6 @@ const DraggableTableHeader = <TData, TValue>({

const DragAlongCell = <TData,>({
cell,
isLoading,
}: {
cell: Cell<TData, unknown>
isLoading?: boolean
Expand All @@ -320,11 +319,7 @@ const DragAlongCell = <TData,>({
'transition-width group relative z-0 opacity-100 transition-transform duration-200 ease-in-out',
isDragging && 'z-10 opacity-80'
)}>
{isLoading ? (
<Skeleton className="h-l w-full" />
) : (
<>{flexRender(cell.column.columnDef.cell, cell.getContext())}</>
)}
<>{flexRender(cell.column.columnDef.cell, cell.getContext())}</>
</TableCell>
)
}
Expand Down Expand Up @@ -424,7 +419,10 @@ const LoadingRows = <TData,>({table}: {table: TableType<TData>}) => {
{Array(30)
.fill({})
.map((_, index) => (
<LoadingRow key={index} table={table} />
<LoadingRow
key={index}
table={table}
/>
))}
</>
)
Expand All @@ -437,8 +435,8 @@ const LoadingRow = <TData,>({table}: {table: TableType<TData>}) => {
<TableRow
className={'hover:bg-inherit'}
key={headerGroup.id}>
{headerGroup.headers.map(() => (
<TableCell>
{headerGroup.headers.map((_, index) => (
<TableCell key={index}>
<Skeleton className="h-l w-full" />
</TableCell>
))}
Expand Down Expand Up @@ -552,7 +550,6 @@ function GenericDataTable<TData extends {id: string}, TValue>(
<DragAlongCell
key={cell.id}
cell={cell}
isLoading={isLoading}
/>
</SortableContext>
))}
Expand Down

0 comments on commit 80f2d6c

Please sign in to comment.