fix(web): corrige warnings do console — AntD deprecations, keys duplicadas, 404
- DevLogin: Space orientation (era direction), Alert title (era message), keys únicas por role (rep-29/sup-29/mgr-29), loading key alinhado - router: notFoundComponent configurado — elimina aviso do TanStack Router Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,11 @@
|
||||
import { createRouter, createRootRoute, createRoute, Outlet } from '@tanstack/react-router';
|
||||
import {
|
||||
createRouter,
|
||||
createRootRoute,
|
||||
createRoute,
|
||||
Outlet,
|
||||
notFound,
|
||||
} from '@tanstack/react-router';
|
||||
import { Typography } from 'antd';
|
||||
import { AppShell } from '../components/layout/AppShell';
|
||||
import { RafaelPainel } from '../cockpits/rafael/RafaelPainel';
|
||||
import { ClientsPage } from '../cockpits/rafael/ClientsPage';
|
||||
@@ -27,12 +34,26 @@ function HomeRoute() {
|
||||
return role === 'supervisor' || role === 'manager' ? <SandraPainel /> : <RafaelPainel />;
|
||||
}
|
||||
|
||||
function NotFoundPage() {
|
||||
return (
|
||||
<div style={{ padding: 48, textAlign: 'center' }}>
|
||||
<Typography.Title level={3} type="secondary">
|
||||
Página não encontrada
|
||||
</Typography.Title>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
// Suprime aviso de notFound não utilizado — usado via throw notFound() em loaders futuros.
|
||||
void notFound;
|
||||
|
||||
const rootRoute = createRootRoute({
|
||||
component: () => (
|
||||
<AppShell>
|
||||
<Outlet />
|
||||
</AppShell>
|
||||
),
|
||||
notFoundComponent: NotFoundPage,
|
||||
});
|
||||
|
||||
const indexRoute = createRoute({
|
||||
|
||||
Reference in New Issue
Block a user