Improve the frontend 3

This commit is contained in:
Urtzi Alfaro
2025-10-30 21:08:07 +01:00
parent 36217a2729
commit 63f5c6d512
184 changed files with 21512 additions and 7442 deletions

View File

@@ -7,7 +7,7 @@ import { formatters } from '../../../../components/ui/Stats/StatsPresets';
import { useIngredients } from '../../../../api/hooks/inventory';
import { useTenantId } from '../../../../hooks/useTenantId';
import { ProductType, ProductCategory, IngredientResponse } from '../../../../api/types/inventory';
import { useToast } from '../../../../hooks/ui/useToast';
import { showToast } from '../../../../utils/toast';
import { usePOSConfigurationData, usePOSConfigurationManager, usePOSTransactions, usePOSTransactionsDashboard, usePOSTransaction } from '../../../../api/hooks/pos';
import { POSConfiguration } from '../../../../api/types/pos';
import { posService } from '../../../../api/services/pos';
@@ -546,7 +546,7 @@ const POSPage: React.FC = () => {
const [testingConnection, setTestingConnection] = useState<string | null>(null);
const tenantId = useTenantId();
const { addToast } = useToast();
// POS Configuration hooks
const posData = usePOSConfigurationData(tenantId);
@@ -674,12 +674,12 @@ const POSPage: React.FC = () => {
});
if (response.success) {
addToast('Conexión exitosa', { type: 'success' });
showToast.success('Conexión exitosa');
} else {
addToast(`Error en la conexión: ${response.message || 'Error desconocido'}`, { type: 'error' });
showToast.error(`Error en la conexión: ${response.message || 'Error desconocido'}`);
}
} catch (error) {
addToast('Error al probar la conexión', { type: 'error' });
showToast.error('Error al probar la conexión');
} finally {
setTestingConnection(null);
}
@@ -695,10 +695,10 @@ const POSPage: React.FC = () => {
tenant_id: tenantId,
config_id: configId,
});
addToast('Configuración eliminada correctamente', { type: 'success' });
showToast.success('Configuración eliminada correctamente');
loadPosConfigurations();
} catch (error) {
addToast('Error al eliminar la configuración', { type: 'error' });
showToast.error('Error al eliminar la configuración');
}
};
@@ -762,7 +762,7 @@ const POSPage: React.FC = () => {
});
setCart([]);
addToast('Venta procesada exitosamente', { type: 'success' });
showToast.success('Venta procesada exitosamente');
};
// Loading and error states