import { Router, type RouteSectionProps } from '@solidjs/router'
import { AppRoutes } from '@/app/routes'
import { AuthProvider } from '@/stores/auth-store'
import { ThemeProvider } from '@/stores/theme-store'

const RootProviders = (props: RouteSectionProps) => (
  <ThemeProvider>
    <AuthProvider>{props.children}</AuthProvider>
  </ThemeProvider>
)

export const App = () => (
  <Router root={RootProviders}>
    <AppRoutes />
  </Router>
)
