import { Navigate, Route, Routes } from 'react-router-dom';

import { Error404 } from '@/errors';
import { TypesSeriesDetailPage } from '@/scene/type/TypesSeriesDetailPage';

import { TypeDetailPage } from './TypesDetailPage';
import { TypesPage } from './TypesPage';
import { TypesSeriesSeasonDetailPage } from './TypesSeriesSeasonDetailPage';

export const TypeRoutes = () => {
  return (
    <Routes>
      <Route path="/" element={<Navigate to="all" replace />} />
      <Route path="all" element={<TypesPage />} />
      <Route path=":typeId/*" element={<TypeDetailPage />} />
      <Route
        path=":typeId/series/:seriesId/*"
        element={<TypesSeriesDetailPage />}
      />
      <Route
        path=":typeId/series/:seriesId/season/:seasonId/*"
        element={<TypesSeriesSeasonDetailPage />}
      />
      <Route path="*" element={<Error404 />} />
    </Routes>
  );
};
