Improve UI

This commit is contained in:
Urtzi Alfaro
2025-12-30 14:40:20 +01:00
parent e494ea8635
commit c07df124fb
71 changed files with 647 additions and 265 deletions

View File

@@ -3,6 +3,7 @@ import { useAuthStore } from '../stores/auth.store';
import { useCurrentTenant } from '../stores/tenant.store';
import { showToast } from '../utils/toast';
import i18n from '../i18n';
import { getTenantCurrencySymbol } from '../hooks/useTenantCurrency';
interface SSEEvent {
type: string;
@@ -211,7 +212,8 @@ export const SSEProvider: React.FC<SSEProviderProps> = ({ children }) => {
// Add financial impact to message if available
if (data.business_impact?.financial_impact_eur) {
message = `${message} • €${data.business_impact.financial_impact_eur} en riesgo`;
const currencySymbol = getTenantCurrencySymbol(currentTenant?.currency);
message = `${message}${currencySymbol}${data.business_impact.financial_impact_eur} en riesgo`;
}
showToast[toastType](message, { title, duration });
@@ -446,7 +448,8 @@ export const SSEProvider: React.FC<SSEProviderProps> = ({ children }) => {
if (data.estimated_impact) {
const impact = data.estimated_impact;
if (impact.savings_eur) {
message = `${message} • €${impact.savings_eur} de ahorro estimado`;
const currencySymbol = getTenantCurrencySymbol(currentTenant?.currency);
message = `${message}${currencySymbol}${impact.savings_eur} de ahorro estimado`;
} else if (impact.risk_reduction_percent) {
message = `${message}${impact.risk_reduction_percent}% reducción de riesgo`;
}