import type { ReactNode } from "react";

import { cn } from "@/lib/utils";

type ModuleScaffoldProps = {
  children?: ReactNode;
  className?: string;
  /** 已处于带外边距的 layout（如代理线路子导航）内时为 true */
  embedded?: boolean;
};

/** 内容区容器；模块标题由侧栏导航体现，此处不再重复大标题与说明。 */
export function ModuleScaffold({ children, className, embedded = false }: ModuleScaffoldProps) {
  return (
    <div
      className={cn(
        embedded
          ? "flex min-h-0 w-full min-w-0 flex-1 flex-col gap-6"
          : "mx-auto flex w-full max-w-[1680px] min-w-0 flex-col gap-6 px-4 py-5 sm:px-6 lg:px-8 lg:py-6",
        className,
      )}
    >
      {children}
    </div>
  );
}
