import { setRequestLocale } from "next-intl/server";
import type { ReactNode } from "react";
import { ServerDetailShell } from "@/components/servers/server-detail-shell";

interface ServerDetailLayoutProps {
  children: ReactNode;
  params: Promise<{ locale: string; id: string }>;
}

export default async function ServerDetailLayout({ children, params }: ServerDetailLayoutProps) {
  const { locale, id } = await params;
  setRequestLocale(locale);

  return <ServerDetailShell serverId={id}>{children}</ServerDetailShell>;
}
