import { Suspense } from 'react'
import { createBrowserRouter } from 'react-router'
import { Layout } from '@/shared/layouts/Layout'
import { landingRoutes } from '@/features/landing/routes'
import { pricingRoutes } from '@/features/pricing/routes'
import { authRoutes } from '@/features/auth/routes'
import { reportRoutes } from '@/features/report/routes'
import { planRoutes } from '@/features/plan/routes'
import { studioRoutes } from '@/features/studio/routes'
import { channelsRoutes } from '@/features/channels/routes'
import { distributionRoutes } from '@/features/distribution/routes'
import { performanceRoutes } from '@/features/performance/routes'
import { clinicsRoutes } from '@/features/clinics/routes'
import { adminRoutes } from '@/features/admin/routes'
import { devRoutes } from '@/features/dev/routes'

export const router = createBrowserRouter([
  {
    element: (
      <Suspense fallback={null}>
        <Layout />
      </Suspense>
    ),
    children: [
      ...landingRoutes,
      ...pricingRoutes,
      ...authRoutes,
      ...reportRoutes,
      ...planRoutes,
      ...studioRoutes,
      ...channelsRoutes,
      ...distributionRoutes,
      ...performanceRoutes,
      ...clinicsRoutes,
      ...adminRoutes,
      ...devRoutes,
    ],
  },
])
