import { createBrowserRouter, Navigate, RouterProvider } from 'react-router';
import './App.css';
import List from './features/books/List';
import Form from './features/books/Form';

const router = createBrowserRouter([
  { path: '/edit/:id', element: <Form /> },
  { path: '/new', element: <Form /> },
  { path: '/list', element: <List /> },
  { path: '*', element: <Navigate to="/list" /> },
]);

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

export default App;

