'use client'

import { usePathname } from 'next/navigation'

import { Sidebar } from '@/components/dashboard/sidebar'

export function AppShell({ children }: { children: React.ReactNode }) {
  const pathname = usePathname()

  const hideSidebar = pathname === '/login' || pathname === '/register'

  return (
    <>
      {!hideSidebar && <Sidebar isRootInstance />}
      <div className="flex-1 min-w-0 overflow-hidden">{children}</div>
    </>
  )
}

