import type { ReactNode } from 'react';
import { SiteFooter } from '@/components/site/site-footer';
import { SiteHeader } from '@/components/site/site-header';
import { buildBotInviteUrl, env } from '@/lib/env';
import { getSession } from '@/lib/session';

export async function SiteShell({ children }: { children: ReactNode }) {
  const session = await getSession();

  return (
    <div className="flex min-h-screen flex-col bg-background text-foreground">
      <SiteHeader
        inviteUrl={buildBotInviteUrl()}
        supportUrl={env.SUPPORT_SERVER_URL}
        isLoggedIn={Boolean(session)}
      />
      <main className="flex-1">{children}</main>
      <SiteFooter />
    </div>
  );
}
