import { Head, Link, usePage } from '@inertiajs/react'; import ProfileNavigation from '@/components/profile-navigation'; import { canShowLegacyManagement, portalNavigation, type PortalNavAccess, } from '@/lib/portal-navigation'; export default function DashboardManagement({ summaryAvailable, }: { summaryAvailable: boolean; }) { const { props } = usePage<{ auth?: { user?: unknown; canManagePortal?: boolean; legacyManagementAccess?: boolean; }; profileAccess?: PortalNavAccess['profileAccess']; opportunityManagement?: PortalNavAccess['opportunityManagement']; contentManagementHref?: PortalNavAccess['contentManagementHref']; contentManagementAccess?: PortalNavAccess['contentManagementAccess']; scopedAdministration?: PortalNavAccess['scopedAdministration']; administrationNavigation?: PortalNavAccess['administrationNavigation']; dashboardNavigation?: PortalNavAccess['dashboardNavigation']; existingBusinessEnabled?: boolean; businessReviewUrl?: string | null; educationEnabled?: boolean; aiEnabled?: boolean; legacyContentEnabled?: boolean; procurementEnabled?: boolean; }>(); const administration = portalNavigation({ authenticated: !!props.auth?.user, manager: canShowLegacyManagement(props.auth), profileAccess: props.profileAccess, opportunityManagement: props.opportunityManagement, contentManagementHref: props.contentManagementHref, contentManagementAccess: props.contentManagementAccess, scopedAdministration: props.scopedAdministration, administrationNavigation: props.administrationNavigation, dashboardNavigation: props.dashboardNavigation, businesses: props.existingBusinessEnabled, businessReviewUrl: props.businessReviewUrl, education: props.educationEnabled, ai: props.aiEnabled, legacyContent: props.legacyContentEnabled, procurement: props.procurementEnabled, }).find((group) => group.id === 'administration'); const groups = administration?.children?.filter( (group) => group.id !== 'collaborative-dashboard', ) ?? []; const managing = summaryAvailable || !!administration; const title = managing ? 'Dashboard de gestão do portal' : 'A minha área de trabalho'; return ( <>

{title}

{managing ? 'Gira as oportunidades, os conteúdos e os acessos do portal nas áreas que lhe estão atribuídas.' : 'Consulte os seus investimentos, as tarefas e os acessos disponíveis para a sua conta.'}

{groups.length > 0 && (
{groups.map((group) => (

{group.label}

))}
)} {managing ? (
A minha conta e oportunidades próprias
) : ( )} ); }