import React, { useState } from 'react'; import { Receipt, DollarSign, TrendingUp, TrendingDown, Clock } from 'lucide-react'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; import { Button } from '@/components/ui/button'; import { Input } from '@/components/ui/input'; import { Label } from '@/components/ui/label'; import { Badge } from '@/components/ui/badge'; import { useToast } from '@/hooks/use-toast'; import { useLanguage } from '@/contexts/LanguageContext'; import { useCurrency } from '@/contexts/CurrencyContext'; const Cashier = () => { const { t } = useLanguage(); const { formatAmount } = useCurrency(); const { toast } = useToast(); const [cashierData] = useState({ openingBalance: 1000.00, currentBalance: 2450.50, totalSales: 1450.50, totalExpenses: 0, transactionsCount: 25, lastTransaction: new Date().toLocaleTimeString() }); const [newTransaction, setNewTransaction] = useState({ type: 'sale', amount: 0, description: '' }); const handleOpenCashier = () => { toast({ title: t('openCashier'), description: t('openCashier') }); }; const handleCloseCashier = () => { toast({ title: t('closeCashier'), description: t('closeCashier') }); }; const handleAddTransaction = () => { if (newTransaction.amount <= 0) { toast({ title: t('error'), description: t('amount'), variant: 'destructive' }); return; } toast({ title: t('success'), description: t('registerTransaction') }); setNewTransaction({ type: 'sale', amount: 0, description: '' }); }; return (
{t('cashierControl')}
{cashierData.transactionsCount} transacciones