Fix: Multilingual and currency selectors not updating
This commit is contained in:
@@ -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: '' });
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user