updated living space added
This commit is contained in:
@@ -8,7 +8,7 @@ import { CSS } from "@dnd-kit/utilities"
|
||||
import { schema, schemaType } from "./schema"
|
||||
import { dateToLocaleString } from "@/lib/utils"
|
||||
import { Pencil, Trash } from "lucide-react"
|
||||
import { IconCircleMinus, IconHandClick } from "@tabler/icons-react"
|
||||
import { IconCircleMinus, IconHandClick, IconHandGrab } from "@tabler/icons-react"
|
||||
|
||||
export function DraggableRow({ row, selectedIDs }: { row: Row<z.infer<typeof schema>>; selectedIDs: string[] }) {
|
||||
const { transform, transition, setNodeRef, isDragging } = useSortable({ id: row.original._id })
|
||||
@@ -120,18 +120,25 @@ function getColumns(appendBuildID: (id: string) => void, removeBuildID: (id: str
|
||||
header: "Actions",
|
||||
cell: ({ row }) => {
|
||||
return (
|
||||
selectedBuildIDS.includes(row.original._id) ? (
|
||||
<div>
|
||||
<Button className="bg-blue-600 border-blue-600 text-white" variant="outline" size="sm" onClick={() => { appendBuildID(row.original._id) }}>
|
||||
<IconHandClick />
|
||||
</Button>
|
||||
</div>
|
||||
) :
|
||||
<div>
|
||||
<Button className="bg-blue-600 border-blue-600 text-white" variant="outline" size="sm" onClick={() => { removeBuildID(row.original._id) }}>
|
||||
<IconCircleMinus />
|
||||
</Button>
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
{defaultSelection !== row.original._id && <div>
|
||||
<Button className="bg-amber-600 border-amber-600 text-white" variant="outline" size="sm" onClick={() => { setDefaultSelection(row.original._id) }}>
|
||||
<IconHandGrab />
|
||||
</Button></div>}
|
||||
{!selectedBuildIDS.includes(row.original._id) ? (
|
||||
<div>
|
||||
<Button className="bg-blue-600 border-blue-600 text-white" variant="outline" size="sm" onClick={() => { appendBuildID(row.original._id) }}>
|
||||
<IconHandClick />
|
||||
</Button>
|
||||
</div>
|
||||
) :
|
||||
<div>
|
||||
<Button className="bg-blue-600 border-blue-600 text-white" variant="outline" size="sm" onClick={() => { removeBuildID(row.original._id) }}>
|
||||
<IconCircleMinus />
|
||||
</Button>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
);
|
||||
},
|
||||
}
|
||||
|
||||
@@ -29,10 +29,8 @@ const PageUsersBuildsTableSection = (
|
||||
|
||||
const handlePageChange = (newPage: number) => { setPage(newPage) };
|
||||
const handlePageSizeChange = (newSize: number) => { setLimit(newSize); setPage(1) };
|
||||
|
||||
if (isLoading) { return <div className="flex items-center justify-center p-8">Loading...</div> }
|
||||
if (error) { return <div className="flex items-center justify-center p-8 text-red-500">Error loading users</div> }
|
||||
|
||||
return <>
|
||||
<UsersBuildDataTable
|
||||
data={data?.data || []} totalCount={data?.totalCount || 0} currentPage={page} pageSize={limit} onPageChange={handlePageChange} onPageSizeChange={handlePageSizeChange}
|
||||
|
||||
Reference in New Issue
Block a user