import { createBrowserRouter } from "react-router-dom";
import {
  LandingPage,
  AboutPage,
  NewsletterPage,
  HomeLayoutPage,
  ErrorPage,
} from "./pages/index";

export const router = createBrowserRouter([
  {
    path: "/",
    element: <HomeLayoutPage />,
    errorElement: <ErrorPage />,
    children: [
      {
        index: true, //indicates this is the default child route for the parent route.
        element: <LandingPage />,
      },
      {
        path: "/about",
        element: <AboutPage />,
      },
      {
        path: "/newsletter",
        element: <NewsletterPage />,
      },
    ],
  },
]);
