Skip to main content

Several in-app links point at routes that don't exist

App.tsx registers a specific route set. Several components navigate to paths that are not in it, so the buttons dead-end at the *NotFound route:

  • /consulta/:slug — the "public consultation" portal link built from a company slug (CompanyDashboard, Onboarding). The only portal route that exists is /portal/:token. The slug-based public URL is assumed throughout but never routed.
  • /admin/companies/:companyId — navigated to after onboarding and company setup (Onboarding, CompanySetup), and the intended home of CompanyDashboard. Not routed → NotFound. (This is why CompanyDashboard is effectively dead — see below.)

Related dead/placeholder surfaces:

  • CompanyDashboard.tsx — imported by nothing, no route: dead code.
  • UserSettings.tsx default export — the standalone page is dead; only its named exports (ProfileTab, NotificationsTab, SecurityTab) are used, embedded in Settings.
  • CompanySetup / UserManagement — reachable only as embedded tabs inside /admin/settings; their standalone useParams branches are dead.
  • Templates.tsx — routed and reachable, but an "Em Desenvolvimento" stub with five hardcoded names and no functionality.
  • "Email dossier" button — permanently disabled with tooltip "Em breve"; the dossier_export_emailed event label exists but nothing emits it.

The tacit assumption: route strings scattered as literals across components stay in sync with the router. They don't — there are no route constants, so nothing catches the drift.

Rebuild implication

Centralise route definitions (typed route constants / a route map), decide the portal URL scheme (/portal/:token vs slug-based /consulta/:slug) once, and delete or finish the dead/stub surfaces rather than porting them.