import { StrictMode } from 'react'
import { createRoot } from 'react-dom/client'
import { createHashRouter, RouterProvider } from 'react-router-dom'
import './index.css'
import { AppShell } from './components/layout/AppShell'
import { TodayView } from './views/TodayView'
import { AllTasksView } from './views/AllTasksView'
import { CategoryView } from './views/CategoryView'
import { CompletedView } from './views/CompletedView'

const router = createHashRouter([
  {
    path: '/',
    element: <AppShell />,
    children: [
      { index: true, element: <TodayView /> },
      { path: 'all', element: <AllTasksView /> },
      { path: 'categories', element: <CategoryView /> },
      { path: 'completed', element: <CompletedView /> },
    ],
  },
])

createRoot(document.getElementById('root')!).render(
  <StrictMode>
    <RouterProvider router={router} />
  </StrictMode>
)
