fix(routing): use resilient path matching for legal pages

This commit is contained in:
Marcio Bevervanso 2026-02-20 16:24:49 -03:00
parent cd5e373c2a
commit 2195d19178

View file

@ -41,13 +41,14 @@ const AppContent: React.FC = () => {
// Helper mapping from path to ViewState internally if needed
const getCurrentView = (): ViewState => {
switch (currentPath) {
case '/faq': return 'faq';
case '/privacidade': return 'privacy';
case '/termos': return 'terms';
case '/exclusao-de-dados': return 'data-deletion';
default: return 'home';
}
const normalizedPath = currentPath.replace(/\/$/, '') || '/';
if (normalizedPath.includes('/faq')) return 'faq';
if (normalizedPath.includes('/privacidade')) return 'privacy';
if (normalizedPath.includes('/termos')) return 'terms';
if (normalizedPath.includes('/exclusao-de-dados')) return 'data-deletion';
return 'home';
};
const currentView = getCurrentView();