import { createBrowserRouter, Navigate, RouterProvider } from 'react-router';
import List from './List';
import Details from './Details';

const router = createBrowserRouter([
  {
    path: '/books',
    element: <List />,
  },
  {
    path: '/books/:bookId',
    element: <Details />,
  },
  {
    path: '*',
    element: <Navigate to="/books" />,
  },
]);

const App: React.FC = () => {
  return <RouterProvider router={router} />;
};

export default App;

