From 5b6313f16f508882a0ea67716b7dbaa1c6967f04 Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Mon, 30 Jun 2025 08:28:13 +0000
Subject: (대표님) 20250630 16시 - 유저 도메인별 라우터 분리와 보안성검토 대응
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../access-control/users-table-toolbar-actions.tsx | 51 ++++++++++++++++++++++
 1 file changed, 51 insertions(+)
 create mode 100644 lib/users/access-control/users-table-toolbar-actions.tsx

(limited to 'lib/users/access-control/users-table-toolbar-actions.tsx')

diff --git a/lib/users/access-control/users-table-toolbar-actions.tsx b/lib/users/access-control/users-table-toolbar-actions.tsx
new file mode 100644
index 00000000..6a431016
--- /dev/null
+++ b/lib/users/access-control/users-table-toolbar-actions.tsx
@@ -0,0 +1,51 @@
+"use client"
+
+import * as React from "react"
+import { type Table } from "@tanstack/react-table"
+import { Download, Upload } from "lucide-react"
+import { toast } from "sonner"
+
+import { exportTableToExcel } from "@/lib/export"
+import { Button } from "@/components/ui/button"
+import { User } from "@/db/schema/users"
+import { AssignDomainDialog } from "./assign-domain-dialog"
+
+interface UsersTableToolbarActionsProps {
+  table: Table<User>
+}
+
+export function UsersTableToolbarActions({ table }: UsersTableToolbarActionsProps) {
+  // 파일 input을 숨기고, 버튼 클릭 시 참조해 클릭하는 방식
+  const fileInputRef = React.useRef<HTMLInputElement>(null)
+
+  return (
+    <div className="flex items-center gap-2">
+
+      {table.getFilteredSelectedRowModel().rows.length > 0 ? (
+        <AssignDomainDialog
+          users={table
+            .getFilteredSelectedRowModel()
+            .rows.map((row) => row.original)}
+        />
+      ) : null}
+
+
+
+      {/** 4) Export 버튼 */}
+      <Button
+        variant="outline"
+        size="sm"
+        onClick={() =>
+          exportTableToExcel(table, {
+            filename: "roles",
+            excludeColumns: ["select", "actions"],
+          })
+        }
+        className="gap-2"
+      >
+        <Download className="size-4" aria-hidden="true" />
+        <span className="hidden sm:inline">Export</span>
+      </Button>
+    </div>
+  )
+}
\ No newline at end of file
-- 
cgit v1.2.3

