import Link from "next/link";
import { SignOutButton } from "@/components/auth/sign-out-button";
import { SessionKeeper } from "@/components/auth/session-keeper";
import { AuthBootstrap } from "@/components/auth/auth-bootstrap";
import { TMDBFooter } from "@/components/shared/tmdb-footer";

export default function AppLayout({ children }: { children: React.ReactNode }) {
  return (
    <div className="flex min-h-screen flex-col">
      <AuthBootstrap />
      <SessionKeeper />
      <header className="border-b border-foreground/10">
        <nav className="mx-auto flex max-w-3xl items-center justify-between px-4 py-3">
          <Link href="/" className="text-lg font-bold text-foreground">
            MovieDice
          </Link>
          <SignOutButton />
        </nav>
      </header>
      <main className="flex-1">{children}</main>
      <TMDBFooter />
    </div>
  );
}
