Fix: Language and currency selectors not working
This commit is contained in:
@@ -7,9 +7,11 @@ 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,
|
||||
@@ -50,55 +52,55 @@ const Cashier = () => {
|
||||
<div className="flex items-center gap-3">
|
||||
<Receipt className="w-8 h-8 text-orange-600" />
|
||||
<div>
|
||||
<h1 className="text-3xl font-bold text-gray-900">Control de Caja</h1>
|
||||
<p className="text-gray-600">Gestiona el flujo de efectivo de tu tienda</p>
|
||||
<h1 className="text-3xl font-bold text-gray-900">{t('cashierControl')}</h1>
|
||||
<p className="text-gray-600">{t('cashierControl')}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex gap-2">
|
||||
<Button onClick={handleOpenCashier}>Abrir Caja</Button>
|
||||
<Button variant="outline" onClick={handleCloseCashier}>Cerrar Caja</Button>
|
||||
<Button onClick={handleOpenCashier}>{t('openCashier')}</Button>
|
||||
<Button variant="outline" onClick={handleCloseCashier}>{t('closeCashier')}</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="grid gap-6 md:grid-cols-4 mb-6">
|
||||
<Card>
|
||||
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
|
||||
<CardTitle className="text-sm font-medium">Saldo Inicial</CardTitle>
|
||||
<CardTitle className="text-sm font-medium">{t('openingBalance')}</CardTitle>
|
||||
<DollarSign className="h-4 w-4 text-muted-foreground" />
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="text-2xl font-bold">${cashierData.openingBalance.toFixed(2)}</div>
|
||||
<div className="text-2xl font-bold">{formatAmount(cashierData.openingBalance)}</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
<Card>
|
||||
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
|
||||
<CardTitle className="text-sm font-medium">Saldo Actual</CardTitle>
|
||||
<CardTitle className="text-sm font-medium">{t('currentBalance')}</CardTitle>
|
||||
<DollarSign className="h-4 w-4 text-muted-foreground" />
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="text-2xl font-bold text-green-600">${cashierData.currentBalance.toFixed(2)}</div>
|
||||
<div className="text-2xl font-bold text-green-600">{formatAmount(cashierData.currentBalance)}</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
<Card>
|
||||
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
|
||||
<CardTitle className="text-sm font-medium">Ventas del Día</CardTitle>
|
||||
<CardTitle className="text-sm font-medium">{t('dailySales')}</CardTitle>
|
||||
<TrendingUp className="h-4 w-4 text-green-600" />
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="text-2xl font-bold">${cashierData.totalSales.toFixed(2)}</div>
|
||||
<div className="text-2xl font-bold">{formatAmount(cashierData.totalSales)}</div>
|
||||
<p className="text-xs text-muted-foreground">{cashierData.transactionsCount} transacciones</p>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
<Card>
|
||||
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
|
||||
<CardTitle className="text-sm font-medium">Gastos</CardTitle>
|
||||
<CardTitle className="text-sm font-medium">{t('expenses')}</CardTitle>
|
||||
<TrendingDown className="h-4 w-4 text-red-600" />
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="text-2xl font-bold text-red-600">${cashierData.totalExpenses.toFixed(2)}</div>
|
||||
<div className="text-2xl font-bold text-red-600">{formatAmount(cashierData.totalExpenses)}</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user