import { faDownload, faFileAlt, faSpinner } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { createNotification } from "@app/components/notifications"; import { Button, Card, CardTitle } from "@app/components/v2"; import { downloadFile } from "@app/helpers/download"; import { useGenerateUsageReport } from "@app/hooks/api/admin/mutation"; export const UsageReportSection = () => { const generateUsageReport = useGenerateUsageReport(); const handleGenerateReport = async () => { try { const response = await generateUsageReport.mutateAsync(); const { csvContent, filename } = response; downloadFile(csvContent, filename, "text/csv"); createNotification({ text: `Usage report downloaded: "${filename}"`, type: "success" }); } catch (error) { console.error("Failed to generate usage report:", error); createNotification({ text: "Failed to generate usage report. Please try again.", type: "error" }); } }; return ( Offline Usage Reports
Generate secure usage reports for offline license compliance and billing verification.
); };