import { Routes, Route, Navigate } from 'react-router-dom';
import { PlaylistListPage } from './pages/PlaylistListPage';
import { PlaylistDetailPage } from './pages/PlaylistDetailPage';

export function PlaylistRoutes() {
  return (
    <Routes>
      <Route path="/" element={<PlaylistListPage />} />
      <Route path="/new" element={<Navigate to="/playlists" replace />} />
      <Route path="/:id" element={<PlaylistDetailPage />} />
      <Route
        path="/:id/edit"
        element={<Navigate to="/playlists/:id" replace />}
      />
      <Route path="*" element={<Navigate to="/playlists" replace />} />
    </Routes>
  );
}
