import type { ReactNode } from "react";

import { AdminSectionHeader } from "@/components/admin/admin-section-header";
import { cn } from "@/lib/utils";

type AdminPageSectionProps = {
  title: string;
  description?: string;
  actions?: ReactNode;
  children: ReactNode;
  className?: string;
  id?: string;
};

/** 无 Card 的页内分区，标题样式与 ConfigSection 相同。 */
export function AdminPageSection({
  title,
  description,
  actions,
  children,
  className,
  id,
}: AdminPageSectionProps) {
  return (
    <section id={id} className={cn("scroll-mt-24 space-y-4", className)}>
      <AdminSectionHeader title={title} description={description} actions={actions} />
      {children}
    </section>
  );
}
