({ row }: { row: Row<z.infer<typeof schema>> })
| 312 | ] |
| 313 | |
| 314 | function DraggableRow({ row }: { row: Row<z.infer<typeof schema>> }) { |
| 315 | const { transform, transition, setNodeRef, isDragging } = useSortable({ |
| 316 | id: row.original.id, |
| 317 | }) |
| 318 | |
| 319 | return ( |
| 320 | <TableRow |
| 321 | data-state={row.getIsSelected() && "selected"} |
| 322 | data-dragging={isDragging} |
| 323 | ref={setNodeRef} |
| 324 | className="relative z-0 data-[dragging=true]:z-10 data-[dragging=true]:opacity-80" |
| 325 | style={{ |
| 326 | transform: CSS.Transform.toString(transform), |
| 327 | transition: transition, |
| 328 | }} |
| 329 | > |
| 330 | {row.getVisibleCells().map((cell) => ( |
| 331 | <TableCell key={cell.id}> |
| 332 | {flexRender(cell.column.columnDef.cell, cell.getContext())} |
| 333 | </TableCell> |
| 334 | ))} |
| 335 | </TableRow> |
| 336 | ) |
| 337 | } |
| 338 | |
| 339 | export function DataTable({ |
| 340 | data: initialData, |
nothing calls this directly
no outgoing calls
no test coverage detected