Fix: Multilingual and currency selectors not updating

This commit is contained in:
gpt-engineer-app[bot]
2025-10-11 14:55:26 +00:00
parent 44979cc34e
commit f2105a81ee
8 changed files with 108 additions and 81 deletions

View File

@@ -6,8 +6,10 @@ 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';
const Cashier = () => {
const { t } = useLanguage();
const { toast } = useToast();
const [cashierData] = useState({
openingBalance: 1000.00,
@@ -25,19 +27,19 @@ const Cashier = () => {
});
const handleOpenCashier = () => {
toast({ title: 'Caja Abierta', description: 'Caja abierta con saldo inicial' });
toast({ title: t('openCashier'), description: t('openCashier') });
};
const handleCloseCashier = () => {
toast({ title: 'Caja Cerrada', description: 'Caja cerrada. Generando reporte...' });
toast({ title: t('closeCashier'), description: t('closeCashier') });
};
const handleAddTransaction = () => {
if (newTransaction.amount <= 0) {
toast({ title: 'Error', description: 'Ingresa un monto válido', variant: 'destructive' });
toast({ title: t('error'), description: t('amount'), variant: 'destructive' });
return;
}
toast({ title: 'Éxito', description: 'Transacción registrada' });
toast({ title: t('success'), description: t('registerTransaction') });
setNewTransaction({ type: 'sale', amount: 0, description: '' });
};