From 1dc24d48e52f2e490f5603ceb02842586ecae533 Mon Sep 17 00:00:00 2001 From: dujinkim Date: Thu, 24 Jul 2025 11:06:32 +0000 Subject: (대표님) 정기평가 피드백 반영, 설계 피드백 반영, (최겸) 기술영업 피드백 반영 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../status/gtc-documents-table-floating-bar.tsx | 90 ++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 lib/gtc-contract/status/gtc-documents-table-floating-bar.tsx (limited to 'lib/gtc-contract/status/gtc-documents-table-floating-bar.tsx') diff --git a/lib/gtc-contract/status/gtc-documents-table-floating-bar.tsx b/lib/gtc-contract/status/gtc-documents-table-floating-bar.tsx new file mode 100644 index 00000000..a9139ed2 --- /dev/null +++ b/lib/gtc-contract/status/gtc-documents-table-floating-bar.tsx @@ -0,0 +1,90 @@ +"use client" + +import * as React from "react" +import { type Table } from "@tanstack/react-table" +import { Download, X } from "lucide-react" + +import { Button } from "@/components/ui/button" +import { Separator } from "@/components/ui/separator" +import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip" + +import { exportTableToCSV } from "@/lib/export" +import { type GtcDocumentWithRelations } from "@/db/schema/gtc" +import { DeleteGtcDocumentsDialog } from "./delete-gtc-documents-dialog" + +interface GtcDocumentsTableFloatingBarProps { + table: Table +} + +export function GtcDocumentsTableFloatingBar({ + table, +}: GtcDocumentsTableFloatingBarProps) { + const rows = table.getFilteredSelectedRowModel().rows + + const [isPending, startTransition] = React.useTransition() + + // Clear selection on Escape key press + React.useEffect(() => { + function handleKeyDown(event: KeyboardEvent) { + if (event.key === "Escape") { + table.toggleAllRowsSelected(false) + } + } + + document.addEventListener("keydown", handleKeyDown) + return () => document.removeEventListener("keydown", handleKeyDown) + }, [table]) + + return ( +
+
+
+
+ + {rows.length} selected + + + + + + + + +

Clear selection

+
+
+
+
+ +
+ + row.original)} + onSuccess={() => table.toggleAllRowsSelected(false)} + /> +
+
+
+
+ ) +} \ No newline at end of file -- cgit v1.2.3