import { ModuleScaffold } from "@/components/admin/module-scaffold";
import { RiskDrawHeader } from "@/modules/risk/risk-draw-header";
import { RiskSubnav } from "@/modules/risk/risk-subnav";

export default async function AdminRiskDrawLayout(props: {
  children: React.ReactNode;
  params: Promise<{ drawId: string }>;
}) {
  const { drawId } = await props.params;
  const id = Number(drawId);
  const safeId = Number.isFinite(id) ? id : 0;

  return (
    <ModuleScaffold>
      <RiskDrawHeader drawId={safeId} />
      <RiskSubnav drawId={drawId} />
      {props.children}
    </ModuleScaffold>
  );
}
