"use client"; import { useState } from "react"; import { FileDown, Loader2, FileSpreadsheet, FileText } from "lucide-react"; import { useExport } from "@/hooks/useExport"; import { toast } from "react-hot-toast"; export function ExportPanel() { const { exportSnapshot, exportAuditTrail, isLoading, error } = useExport(); const handleExportSnapshot = async (format: "csv" | "xlsx") => { try { await exportSnapshot(format); const formatName = format === "csv" ? "CSV" : "Excel"; toast.success(`Inventory snapshot exported as ${formatName}`); } catch (err) { // Error handled by hook } }; const handleExportAuditTrail = async (format: "csv" | "xlsx") => { try { await exportAuditTrail(format); const formatName = format === "csv" ? "CSV" : "Excel"; toast.success(`Audit trail exported as ${formatName}`); } catch (err) { // Error handled by hook } }; return (

Export & Reports

Download system snapshots and action logs

{/* Inventory Snapshot Section */}

Inventory Snapshot

Export current inventory state with all item details and locations.

{/* Audit Trail Section */}

Audit Trail

Complete history of system actions, changes, and user operations.

{error && (
Error: {error}
)}
); }