import { CreateStudio } from "@/components/create-studio";

export default async function CreatePage({
  searchParams
}: {
  searchParams?: Promise<Record<string, string | string[] | undefined>>;
}) {
  const params = await searchParams;
  const modeParam = Array.isArray(params?.mode) ? params?.mode[0] : params?.mode;
  const initialMode = modeParam === "video" || modeParam === "inpaint" || modeParam === "upscale"
    ? modeParam
    : modeParam === "edit"
      ? "inpaint"
      : "image";
  return <CreateStudio initialMode={initialMode} />;
}
