import { Head, Link, router } from '@inertiajs/react'; import { PageTitle, Panel } from '@/components/procurement'; import { Button } from '@/components/ui/button'; import { roleLabels, statusLabels } from '@/types/procurement'; type Props = { ready: boolean; unread: number; view: string; notices: { total: number; data: { id: number; reference: string; role: string; kind: string; outcome: string | null; current_status: string; created_at: string; read_at: string | null; href: string; }[]; prev_page_url: string | null; next_page_url: string | null; }; }; export default function Notices({ ready, unread, view, notices }: Props) { return ( <>
Todos os visíveis Intervenções pendentes Resultados dos meus pedidos Por ler ({unread}) As minhas aprovações
{!ready ? (

Instalação dos avisos internos pendente.

) : notices.data.length === 0 ? (

Sem avisos neste âmbito.

) : ( notices.data.map((notice) => (
{notice.reference} ·{' '} {roleLabels[notice.role] ?? notice.role} {notice.kind === 'outcome' && (

Resultado registado:{' '} {notice.outcome === 'approved' ? 'requisição aprovada' : 'requisição rejeitada'} . Estado actual:{' '} {statusLabels[notice.current_status] ?? notice.current_status} . Consulte o processo para conhecer o fundamento e os passos seguintes.

)}

{notice.read_at ? 'Lido' : 'Por ler'} · Criado em {notice.created_at}

{!notice.read_at && ( )}
)) )}
{notices.prev_page_url && ( Anterior )} {notices.next_page_url && ( Seguinte )}
); }