import React, { useState } from 'react'; import { Search, Download, Printer, Calendar, Filter, BarChart3, PieChart, LineChart, ArrowUpRight, RefreshCw, FileText } from 'lucide-react'; import { Button } from "../ui/button"; import { Input } from "../ui/input"; import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from "../ui/table"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "../ui/select"; import { Tabs, TabsContent, TabsList, TabsTrigger } from "../ui/tabs"; import { Card, CardContent, CardHeader, CardTitle, CardDescription } from "../ui/card"; import { Badge } from "../ui/badge"; import { BarChart, Bar, XAxis, YAxis, CartesianGrid, Tooltip, Legend, ResponsiveContainer, Line, LineChart as RechartsLineChart } from 'recharts'; import { toast } from "sonner@2.0.3"; import { cn } from "../ui/utils"; // --- Mock Data --- const MOCK_PRINT_LOG = [ { id: '1-251201', productName: 'Whole Milk', category: 'Dairy', printedAt: '2024-03-20 09:30 AM', printedBy: 'Alice Johnson', location: 'Downtown Store (101)', expiryDate: '2024-03-27', status: 'Valid' }, { id: '2-251201', productName: 'Ground Beef', category: 'Meat', printedAt: '2024-03-20 10:15 AM', printedBy: 'Bob Smith', location: 'Uptown Store (102)', expiryDate: '2024-03-23', status: 'Valid' }, { id: '3-251201', productName: 'Croissant', category: 'Bakery', printedAt: '2024-03-19 14:00 PM', printedBy: 'Charlie Brown', location: 'Downtown Store (101)', expiryDate: '2024-03-20', status: 'Expired' }, { id: '4-251201', productName: 'Caesar Salad', category: 'Deli', printedAt: '2024-03-18 11:45 AM', printedBy: 'Alice Johnson', location: 'Downtown Store (101)', expiryDate: '2024-03-21', status: 'Expiring Soon' }, { id: '5-251201', productName: 'Orange Juice', category: 'Beverage', printedAt: '2024-03-18 08:20 AM', printedBy: 'Bob Smith', location: 'Airport Kiosk (201)', expiryDate: '2024-03-25', status: 'Valid' }, ]; const MOCK_CATEGORY_STATS = [ { name: 'Dairy', count: 450 }, { name: 'Meat', count: 320 }, { name: 'Bakery', count: 280 }, { name: 'Deli', count: 190 }, { name: 'Produce', count: 150 }, { name: 'Beverage', count: 120 }, ]; const MOCK_USAGE_TRENDS = [ { date: 'Mon', count: 120 }, { date: 'Tue', count: 132 }, { date: 'Wed', count: 101 }, { date: 'Thu', count: 134 }, { date: 'Fri', count: 190 }, { date: 'Sat', count: 230 }, { date: 'Sun', count: 210 }, ]; export function ReportsView() { const [activeTab, setActiveTab] = useState('print-log'); const handleReprint = (labelId: string) => { // Logic to reprint would go here // For now, we simulate the action toast.success(`Reprinting label ${labelId}`, { description: "Watermark 'RePrint' applied.", }); }; return (
+20.1% from last month
450 labels generated
182 labels generated
+12% from last week