import { Link, router } from '@inertiajs/react'; import { Frame, card, button } from './shared'; export default function Notifications({ unread, notifications, }: { unread: number; notifications: { data: { id: string; submission_id: string; kind: string; payload: { status?: string; reference?: string }; read_at: string | null; created_at: string; }[]; prev_page_url: string | null; next_page_url: string | null; }; }) { const states: Record = { received: 'Recebido', in_review: 'Em análise', contacted: 'Contactado', closed: 'Encerrado', }; return ( Área do investidor

{unread} notificações por ler

{notifications.data.map((n) => (

{n.kind === 'received' ? 'Manifestação recebida' : n.kind === 'status' ? 'Estado actualizado' : 'Nova mensagem na conversa'}

{n.payload.reference ?? (n.payload.status ? (states[n.payload.status] ?? n.payload.status) : 'Consulte o pedido para ler a mensagem.')}

{new Date(n.created_at).toLocaleString('pt-MZ')}

Abrir manifestação {!n.read_at && ( )}
))} {!notifications.data.length && (

Ainda não existem notificações.

)} ); }