mirror of
https://github.com/lucasrcsantana/story-generator.git
synced 2025-12-18 14:27:51 +00:00
- Substitui Dialog básico pelo AlertDialog especializado - Melhora feedback visual na confirmação de deleção - Mantém consistência com o design system - Implementa padrões de acessibilidade do Radix UI
268 lines
7.8 KiB
TypeScript
268 lines
7.8 KiB
TypeScript
import { createBrowserRouter } from 'react-router-dom';
|
|
import { BaseLayout } from './components/layouts/BaseLayout';
|
|
import { HomePage } from './components/home/HomePage';
|
|
import { LoginForm } from './components/auth/LoginForm';
|
|
import { SchoolRegistrationForm } from './components/auth/SchoolRegistrationForm';
|
|
import { RegistrationForm } from './components/RegistrationForm';
|
|
import { AuthCallback } from './pages/AuthCallback';
|
|
import { DashboardLayout } from './pages/dashboard/DashboardLayout';
|
|
import { DashboardHome } from './pages/dashboard/DashboardHome';
|
|
import { ClassesPage } from './pages/dashboard/classes/ClassesPage';
|
|
import { CreateClassPage } from './pages/dashboard/classes/CreateClassPage';
|
|
import { TeachersPage } from './pages/dashboard/teachers/TeachersPage';
|
|
import { InviteTeacherPage } from './pages/dashboard/teachers/InviteTeacherPage';
|
|
import { StudentsPage } from './pages/dashboard/students/StudentsPage';
|
|
import { AddStudentPage } from './pages/dashboard/students/AddStudentPage';
|
|
import { SettingsPage } from './pages/dashboard/settings/SettingsPage';
|
|
import { StudentDashboardPage } from './pages/student-dashboard/StudentDashboardPage';
|
|
import { StudentDashboardLayout } from './pages/student-dashboard/StudentDashboardLayout';
|
|
import { StudentStoriesPage } from './pages/student-dashboard/StudentStoriesPage';
|
|
import { StudentSettingsPage } from './pages/student-dashboard/StudentSettingsPage';
|
|
import { CreateStoryPage } from './pages/student-dashboard/CreateStoryPage';
|
|
import { StoryPageDemo } from './pages/demo/StoryPageDemo';
|
|
import { StoryPage } from './pages/student-dashboard/StoryPage';
|
|
import { ProtectedRoute } from './components/auth/ProtectedRoute';
|
|
import { UserManagementPage } from './pages/admin/UserManagementPage';
|
|
import { AchievementsPage } from './pages/student-dashboard/AchievementsPage';
|
|
import { StudentClassPage } from './pages/student-dashboard/StudentClassPage';
|
|
import { ParentsLandingPage } from './pages/landing/ParentsLandingPage';
|
|
import { EducationalForParents } from './pages/landing/EducationalForParents';
|
|
import { TestWordHighlighter } from './pages/TestWordHighlighter';
|
|
import { ExercisePage } from './pages/student-dashboard/ExercisePage';
|
|
import { EvidenceBased } from './pages/landing/EvidenceBased';
|
|
import { TextSalesLetter } from './pages/landing/TextSalesLetter';
|
|
import { PhonicsPage } from "./pages/student-dashboard/PhonicsPage";
|
|
import { PhonicsProgressPage } from "./pages/student-dashboard/PhonicsProgressPage";
|
|
import { EssaysPage } from './pages/student-dashboard/essays';
|
|
import { NewEssay } from './pages/student-dashboard/essays/NewEssay';
|
|
import { EssayPage } from './pages/student-dashboard/essays/EssayPage';
|
|
import { EssayAnalysis } from './pages/student-dashboard/essays/EssayAnalysis';
|
|
|
|
function RootLayout({ children }: { children: React.ReactNode }) {
|
|
return (
|
|
<>
|
|
{children}
|
|
</>
|
|
);
|
|
}
|
|
|
|
export const router = createBrowserRouter([
|
|
{
|
|
path: '/',
|
|
element: <BaseLayout />,
|
|
children: [
|
|
{
|
|
path: '/',
|
|
element: <RootLayout><HomePage /></RootLayout>,
|
|
},
|
|
{
|
|
path: '/teste',
|
|
element: <TestWordHighlighter />,
|
|
},
|
|
{
|
|
path: '/para-pais',
|
|
element: <ParentsLandingPage />,
|
|
},
|
|
{
|
|
path: '/evidencias',
|
|
element: <EvidenceBased />,
|
|
},
|
|
{
|
|
path: '/evidencias/tsl',
|
|
element: <TextSalesLetter />,
|
|
},
|
|
{
|
|
path: '/login',
|
|
children: [
|
|
{
|
|
path: 'school',
|
|
element: <LoginForm userType="school" />,
|
|
},
|
|
{
|
|
path: 'teacher',
|
|
element: <LoginForm userType="teacher" />,
|
|
},
|
|
{
|
|
path: 'student',
|
|
element: <LoginForm userType="student" />,
|
|
}
|
|
]
|
|
},
|
|
{
|
|
path: '/register',
|
|
children: [
|
|
{
|
|
path: 'school',
|
|
element: <SchoolRegistrationForm />,
|
|
},
|
|
{
|
|
path: 'teacher',
|
|
element: <RegistrationForm
|
|
userType="teacher"
|
|
onComplete={(userData) => {
|
|
console.log('Registro completo:', userData);
|
|
}}
|
|
/>,
|
|
}
|
|
]
|
|
},
|
|
{
|
|
path: '/dashboard',
|
|
element: (
|
|
<ProtectedRoute allowedRoles={['school']}>
|
|
<DashboardLayout />
|
|
</ProtectedRoute>
|
|
),
|
|
children: [
|
|
{
|
|
index: true,
|
|
element: <DashboardHome />,
|
|
},
|
|
{
|
|
path: 'turmas',
|
|
children: [
|
|
{
|
|
index: true,
|
|
element: <ClassesPage />,
|
|
},
|
|
{
|
|
path: 'nova',
|
|
element: <CreateClassPage />,
|
|
}
|
|
]
|
|
},
|
|
{
|
|
path: 'professores',
|
|
children: [
|
|
{
|
|
index: true,
|
|
element: <TeachersPage />,
|
|
},
|
|
{
|
|
path: 'convidar',
|
|
element: <InviteTeacherPage />,
|
|
}
|
|
]
|
|
},
|
|
{
|
|
path: 'alunos',
|
|
children: [
|
|
{
|
|
index: true,
|
|
element: <StudentsPage />,
|
|
},
|
|
{
|
|
path: 'novo',
|
|
element: <AddStudentPage />,
|
|
}
|
|
]
|
|
},
|
|
{
|
|
path: 'configuracoes',
|
|
element: <SettingsPage />
|
|
}
|
|
]
|
|
},
|
|
{
|
|
path: '/demo',
|
|
element: <StoryPageDemo />
|
|
},
|
|
{
|
|
path: '/auth/callback',
|
|
element: <AuthCallback />
|
|
},
|
|
{
|
|
path: '/aluno',
|
|
element: (
|
|
<ProtectedRoute allowedRoles={['student']}>
|
|
<StudentDashboardLayout />
|
|
</ProtectedRoute>
|
|
),
|
|
children: [
|
|
{
|
|
index: true,
|
|
element: <StudentStoriesPage />,
|
|
},
|
|
{
|
|
path: 'historias',
|
|
children: [
|
|
{
|
|
index: true,
|
|
element: <StudentStoriesPage />,
|
|
},
|
|
{
|
|
path: 'nova',
|
|
element: <CreateStoryPage />,
|
|
},
|
|
{
|
|
path: ':id',
|
|
element: <StoryPage />,
|
|
}
|
|
]
|
|
},
|
|
{
|
|
path: 'configuracoes',
|
|
element: <StudentSettingsPage />,
|
|
},
|
|
{
|
|
path: 'painel',
|
|
element: <StudentDashboardPage />,
|
|
},
|
|
{
|
|
path: 'conquistas',
|
|
element: <AchievementsPage />,
|
|
},
|
|
{
|
|
path: 'turmas/:classId',
|
|
element: <StudentClassPage />,
|
|
},
|
|
{
|
|
path: 'fonicos',
|
|
element: <PhonicsPage />,
|
|
},
|
|
{
|
|
path: 'fonicos/progresso',
|
|
element: <PhonicsProgressPage />,
|
|
},
|
|
{
|
|
path: 'redacoes',
|
|
children: [
|
|
{
|
|
index: true,
|
|
element: <EssaysPage />,
|
|
},
|
|
{
|
|
path: 'nova',
|
|
element: <NewEssay />,
|
|
},
|
|
{
|
|
path: ':id',
|
|
element: <EssayPage />,
|
|
},
|
|
{
|
|
path: ':id/analise',
|
|
element: <EssayAnalysis />,
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
path: '/admin/users',
|
|
element: (
|
|
<ProtectedRoute allowedRoles={['admin']}>
|
|
<UserManagementPage />
|
|
</ProtectedRoute>
|
|
),
|
|
},
|
|
{
|
|
path: '/para-educadores',
|
|
element: <EducationalForParents />,
|
|
},
|
|
{
|
|
path: '/aluno/historias/:id/exercicios/:type',
|
|
element: <ExercisePage />
|
|
}
|
|
]
|
|
}
|
|
]);
|