
'use client';

import { usePathname } from 'next/navigation';
import { Header } from './header';

export function MainLayout({ children }: { children: React.ReactNode }) {
  const pathname = usePathname();
  const isAdminPage = pathname.startsWith('/admin');

  return (
    <div className="flex min-h-screen w-full flex-col">
      {!isAdminPage && <Header />}
      <main
        className={`flex flex-1 flex-col ${
          !isAdminPage && 'gap-4 bg-muted/40 p-4 md:gap-8 md:p-10'
        }`}
      >
        {children}
      </main>
    </div>
  );
}
