import Login from '@/pages/Login.tsx'
import Manager from '@/pages/Manager.tsx'
import AuthRoute from '@/AuthRoute.tsx'

const routes: RouteObject[] = [
    {
        path: '/',
        element: <AuthRoute />,
        children: [
            {
                path: '/login',
                id: 'login',
                element: <Login />
            },
            {
                path: '',
                id: 'manager',
                element: <Manager />,
                children: [
                    {
                        id: 'manager-sub',
                        path: 'sub',
                        element: <Manager />
                    }
                ],
                handle: {
                    auth: true
                }
            },
            {
                path: '*',
                element: <Navigate to="/" replace />
            }
        ]
    }
]

const router = createBrowserRouter(routes)
export default router
