'use client'; /** * DocumentsList — Displays a list of available documents for the user. * * Each entry shows the document name, type (statement/contract/report), * and a download action button. Uses Divisi design system styling. * * Requirements: 14.1, 14.2, 14.3 */ import type { PortalDocument } from '@/lib/mock-data/types'; import { useTranslation } from '@/lib/hooks/useTranslation'; import type { TranslationKeys } from '@/lib/i18n/translations'; interface DocumentsListProps { documents: PortalDocument[]; } function getTypeLabel(type: PortalDocument['type'], t: TranslationKeys): string { switch (type) { case 'statement': return t.portal.docTypeStatement; case 'contract': return t.portal.docTypeContract; case 'report': return t.portal.docTypeReport; default: return type; } } const TYPE_COLORS: Record = { statement: 'bg-blue-500/10 text-blue-400', contract: 'bg-emerald-500/10 text-emerald-400', report: 'bg-amber-500/10 text-amber-400', }; export default function DocumentsList({ documents }: DocumentsListProps) { const t = useTranslation(); if (documents.length === 0) { return (

{t.portal.noDocs}

); } return (
{/* Table header */}
{t.portal.docName} {t.portal.docType} {t.portal.docAction}
{/* Document rows */}
); }