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 -m-6">
      <MemberNav />
      <main className="flex-1 overflow-auto bg-muted/30 p-6">{children}</main>
    </div>
  );
}
