"use client"; import * as React from "react"; import { Button } from "@/components/ui/button"; import { Download, Trash2 } from "lucide-react"; import { toast } from "sonner"; import type { Table } from "@tanstack/react-table"; interface ComplianceResponsesToolbarActionsProps { table: Table; } export function ComplianceResponsesToolbarActions({ table, }: ComplianceResponsesToolbarActionsProps) { const selectedRows = table.getFilteredSelectedRowModel().rows; const handleDeleteSelected = async () => { if (selectedRows.length === 0) { toast.error("삭제할 응답을 선택해주세요."); return; } // TODO: 선택된 응답들 삭제 기능 구현 console.log("Delete selected responses:", selectedRows.map(row => row.original)); toast.success(`${selectedRows.length}개의 응답이 삭제되었습니다.`); // 페이지 새로고침으로 데이터 업데이트 window.location.reload(); }; const handleExport = () => { if (selectedRows.length === 0) { toast.error("내보낼 응답을 선택해주세요."); return; } // TODO: 선택된 응답들 내보내기 기능 구현 console.log("Export selected responses:", selectedRows.map(row => row.original)); toast.success(`${selectedRows.length}개의 응답이 내보내졌습니다.`); }; return (
{selectedRows.length > 0 && ( <> )}
); }