Skip to content

Commit 6dcb23f

Browse files
committed
feat: improve UI design of DelegationDetailPanel and add Spanish i18n support
1 parent 34ad569 commit 6dcb23f

1 file changed

Lines changed: 29 additions & 11 deletions

File tree

src/apps/ums.web-app/src/presentation/identity/delegation/components/DelegationDetailPanel.tsx

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ import { Delegation } from '@domain/identity/models/delegation.model';
44
import { DetailPanelShell, DetailTab } from '@shared/components/DetailPanelShell';
55
import { DelegationProfileCard } from './DelegationProfileCard';
66
import { useI18n } from '@app/i18n/use-i18n';
7+
import { KeyValueRow } from '@shared/components/KeyValueRow';
8+
import { CodeBadge } from '@shared/components/CodeBadge';
9+
import { Calendar, AlertCircle } from 'lucide-react';
710

811
export type DelegationConsoleTab = 'overview' | 'permissions';
912

@@ -44,8 +47,8 @@ export const DelegationDetailPanel: React.FC<DelegationDetailPanelProps> = ({
4447
};
4548

4649
const labels: Record<DelegationConsoleTab, string> = {
47-
overview: 'Overview',
48-
permissions: 'Permissions',
50+
overview: t.overview ?? 'Resumen',
51+
permissions: t.permissions ?? 'Permisos',
4952
};
5053

5154
const tabs: DetailTab<DelegationConsoleTab>[] = consoleTabs.map((tab) => ({
@@ -73,21 +76,36 @@ export const DelegationDetailPanel: React.FC<DelegationDetailPanelProps> = ({
7376
}
7477
>
7578
{activeConsoleTab === 'overview' && activeDelegation && (
76-
<div className="p-4 text-sm text-m3-on-surface-variant">
77-
<p><strong>Valid From:</strong> {formatDate(activeDelegation.validFrom)}</p>
78-
<p><strong>Valid Until:</strong> {formatDate(activeDelegation.validUntil)}</p>
79-
<p><strong>Requires Approval:</strong> {activeDelegation.requiresApproval ? 'Yes' : 'No'}</p>
79+
<div className="p-5 flex flex-col gap-3">
80+
<KeyValueRow
81+
icon={<Calendar className="w-3.5 h-3.5" />}
82+
label={t.validFrom ?? 'Válido desde'}
83+
value={formatDate(activeDelegation.validFrom)}
84+
/>
85+
<KeyValueRow
86+
icon={<Calendar className="w-3.5 h-3.5" />}
87+
label={t.validUntil ?? 'Válido hasta'}
88+
value={formatDate(activeDelegation.validUntil)}
89+
/>
90+
<KeyValueRow
91+
icon={<AlertCircle className="w-3.5 h-3.5" />}
92+
label={t.requiresApproval ?? 'Requiere Aprobación'}
93+
value={activeDelegation.requiresApproval ? (t.yes ?? 'Sí') : (t.no ?? 'No')}
94+
bordered={false}
95+
/>
8096
</div>
8197
)}
8298

8399
{activeConsoleTab === 'permissions' && activeDelegation && (
84-
<div className="p-4">
85-
<h4 className="text-sm font-semibold mb-2 text-m3-on-surface">Allowed Actions</h4>
86-
<ul className="list-disc list-inside text-sm text-m3-on-surface-variant">
100+
<div className="p-5">
101+
<h4 className="text-xs font-bold uppercase tracking-wider text-m3-secondary mb-3">
102+
{t.allowedActions ?? 'Acciones Permitidas'}
103+
</h4>
104+
<div className="flex flex-wrap gap-2">
87105
{activeDelegation.allowedActions.map((action) => (
88-
<li key={action}>{action}</li>
106+
<CodeBadge key={action} code={action} />
89107
))}
90-
</ul>
108+
</div>
91109
</div>
92110
)}
93111
</DetailPanelShell>

0 commit comments

Comments
 (0)