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

import { Error404 } from '@/errors';
import { SeriesSeasonDetailPage } from './SeriesSeasonDetailPage';
import { SeriesDetailPage } from './SeriesDetailPage';
import { SeriesPage } from './SeriesPage';

export const SeriesRoutes = () => {
  return (
    <Routes>
      <Route path="/" element={<Navigate to="all" replace />} />
      <Route path="all" element={<SeriesPage />} />
      <Route path=":SeriesId/*" element={<SeriesDetailPage />} />
      <Route
        path=":SeriesId/Season/:SeasonId/*"
        element={<SeriesSeasonDetailPage />}
      />
      <Route path="*" element={<Error404 />} />
    </Routes>
  );
};
