import { Management, Pagination, type Paginated } from '../management/shared'; import type { OpportunityTechnicalIncident } from '@/components/opportunity-technical-incidents'; import { Link } from '@inertiajs/react'; import { handlingLabels, incidentOperationLabel, incidentErrorLabel, } from '@/lib/technical-incident-labels'; import type { HandlingState } from '@/lib/technical-incident-handling'; import TechnicalIncidentNotice from '@/components/technical-incident-notice'; export default function TechnicalSupport({ incidents, actorId, filters = { status: 'all' }, }: { actorId?: number; incidents: Paginated< OpportunityTechnicalIncident & { handling?: HandlingState | null; details_url?: string; unread?: boolean; } >; filters?: { status: string; unread?: boolean }; }) { function href(status: string, unread = !!filters.unread) { const query = new URLSearchParams({ ...(status !== 'all' ? { status } : {}), ...(unread ? { unread: '1' } : {}), }).toString(); return '/suporte-tecnico/incidentes' + (query ? '?' + query : ''); } return (

Incidentes de submissão, publicação, uploads e preparação de imagens nas organizações e tipos abrangidos pela sua atribuição actual. A fila apresenta metadados técnicos; o perfil de suporte não concede acesso aos processos ou documentos.

{!incidents.data.length && (

Não existem incidentes disponíveis neste âmbito.

)} {incidents.data.map((incident) => (

{incidentOperationLabel(incident.operation)} · versão observada {incident.version}

{incident.occurred_at}

{incidentErrorLabel(incident.error_code)}

Referência: {incident.reference}

{actorId && typeof incident.unread === 'boolean' && ( )} {incident.handling ? (

Estado técnico:{' '} {handlingLabels[incident.handling.status]} ·{' '} {incident.handling.assignee_name || 'Por assumir'}

) : (

Estado técnico indisponível; registos preservados.

)} {incident.details_url && ( 1 || filters.status !== 'all' || filters.unread ? '?' + new URLSearchParams({ ...(incidents.current_page > 1 ? { page: String( incidents.current_page, ), } : {}), ...(filters.status !== 'all' ? { status: filters.status } : {}), ...(filters.unread ? { unread: '1' } : {}), }).toString() : '') } > Consultar e tratar incidente )}
))}
); }