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

@@ -19,6 +19,7 @@ import { AlertTriangle, Clock, XCircle, CheckCircle } from 'lucide-react';
import { Button } from '../../ui/Button';
import { Badge } from '../../ui/Badge';
import { useTranslation } from 'react-i18next';
import { useTenantCurrency } from '../../../hooks/useTenantCurrency';
export interface AutoActionCountdownProps {
actionDescription: string;
@@ -38,6 +39,7 @@ export function AutoActionCountdownComponent({
className = '',
}: AutoActionCountdownProps) {
const { t } = useTranslation('alerts');
const { currencySymbol } = useTenantCurrency();
const [timeRemaining, setTimeRemaining] = useState(countdownSeconds);
const [isCancelling, setIsCancelling] = useState(false);
const [isCancelled, setIsCancelled] = useState(false);
@@ -249,7 +251,7 @@ export function AutoActionCountdownComponent({
{t('auto_action.financial_impact', 'Impact:')}
</span>{' '}
<span className="font-bold" style={{ color: 'var(--text-primary)' }}>
{financialImpactEur.toFixed(2)}
{currencySymbol}{financialImpactEur.toFixed(2)}
</span>
</div>
)}

View File

@@ -6,6 +6,7 @@ import { Badge } from '../../ui/Badge';
import { Button } from '../../ui/Button';
import { useCurrentTenant } from '../../../stores/tenant.store';
import { usePendingApprovalPurchaseOrders, useApprovePurchaseOrder, useRejectPurchaseOrder } from '../../../api/hooks/purchase-orders';
import { useTenantCurrency } from '../../../hooks/useTenantCurrency';
import {
ShoppingCart,
Clock,
@@ -40,6 +41,7 @@ const PendingPOApprovals: React.FC<PendingPOApprovalsProps> = ({
const { t } = useTranslation(['dashboard']);
const currentTenant = useCurrentTenant();
const tenantId = currentTenant?.id || '';
const { currencySymbol } = useTenantCurrency();
const [approvingPO, setApprovingPO] = useState<string | null>(null);
const [rejectingPO, setRejectingPO] = useState<string | null>(null);
@@ -145,10 +147,7 @@ const PendingPOApprovals: React.FC<PendingPOApprovalsProps> = ({
const formatCurrency = (amount: string, currency: string = 'EUR') => {
const value = parseFloat(amount);
if (currency === 'EUR') {
return `${value.toFixed(2)}`;
}
return `${value.toFixed(2)} ${currency}`;
return `${currencySymbol}${value.toFixed(2)}`;
};
const formatDate = (dateStr: string) => {