import { getMemberToken } from '../_lib/api';
import { redirect } from 'next/navigation';
import { MemberNav } from './member-nav';

export default async function MemberLayout({ children }: { children: React.ReactNode }) {
  const token = await getMemberToken();
  if (!token) redirect('/member-login');

  return (
    <div className="flex h-screen overflow-hidden">
      <MemberNav />
      <main className="flex-1 overflow-auto bg-muted/30">
        <div className="p-6 lg:p-8 max-w-6xl mx-auto w-full">{children}</div>
      </main>
    </div>
  );
}
