MCPcopy Create free account
hub / github.com/Codehagen/Badget / DraggableRow

Function DraggableRow

src/components/data-table.tsx:314–337  ·  view source on GitHub ↗
({ row }: { row: Row<z.infer<typeof schema>> })

Source from the content-addressed store, hash-verified

312]
313
314function 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
339export function DataTable({
340 data: initialData,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected