blob: cb52b2ede7a59a124ccaa65df91a1c5310c2c791 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
"use client"
import { type Table } from "@tanstack/react-table"
import { Download } from "lucide-react"
import { exportTableToCSV } from "@/lib/export"
import { Button } from "@/components/ui/button"
import { type GtcDocumentWithRelations } from "@/db/schema/gtc"
import { CreateGtcDocumentDialog } from "./create-gtc-document-dialog"
interface GtcDocumentsTableToolbarActionsProps {
table: Table<GtcDocumentWithRelations>
}
export function GtcDocumentsTableToolbarActions({
table,
}: GtcDocumentsTableToolbarActionsProps) {
return (
<div className="flex items-center gap-2">
{table.getFilteredSelectedRowModel().rows.length > 0 ? (
<Button
variant="outline"
size="sm"
onClick={() =>
exportTableToCSV(table, {
filename: "gtc-documents",
excludeColumns: ["select", "actions"],
})
}
>
<Download className="mr-2 size-4" aria-hidden="true" />
Export ({table.getFilteredSelectedRowModel().rows.length})
</Button>
) : null}
<CreateGtcDocumentDialog />
</div>
)
}
|