import { Head, Link, router } from '@inertiajs/react'; import { useState } from 'react'; import ProfileNavigation from '@/components/profile-navigation'; import { createOperationKey } from '@/lib/operation-key'; import { profileJson } from '@/lib/profile-json'; import { button, control } from '@/pages/management/shared'; type Entry = { id: string; user_id: number; status: string; version: number; opportunity_types: string; document_ids: string; reason: string; }; type SecurityEntry = { id: string; kind: string; requested_by: number; subject_user_id: number; scope: string; reason: string; approved_by: number | null; consumed_at: string | null; expires_at: string; }; type Pair = { first_user_id: number; second_user_id: number; version: number }; type OperatorOrganization = { id: string; name: string; nuit: string; contact: string; director: string; }; function OperatorOrganizationForm() { const [operationKey] = useState(createOperationKey); const [name, setName] = useState('Tempo Lda'); const [nuit, setNuit] = useState('400993114'); const [contact, setContact] = useState('+258868010880'); const [director, setDirector] = useState('Osmane Nala'); const [source, setSource] = useState( 'Dados e designação interna confirmados pelo responsável da Tempo em 11/10/2026.', ); const [busy, setBusy] = useState(false); const [message, setMessage] = useState(''); async function save() { setBusy(true); try { const result = await profileJson('/perfis/organizacao-operadora', { operation_key: operationKey, name, nuit, contact, director, function: 'portal_owner_operator', source_reference: source, }); setMessage(result.message); router.reload(); } catch (error) { setMessage( error instanceof Error ? error.message : 'Resposta indisponível.', ); } finally { setBusy(false); } } return (

Organização proprietária e operadora

Seleccione a organização responsável pelo portal. As permissões dos utilizadores são definidas separadamente.

{ e.preventDefault(); void save(); }} >