import type { ReactNode } from "react";

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

type ConfigSectionProps = {
  title: string;
  description?: string;
  actions?: ReactNode;
  children: ReactNode;
  className?: string;
  /** 页内锚点，供旧链接跳转（如 #records） */
  id?: string;
};

export function ConfigSection({
  title,
  description,
  actions,
  children,
  className,
  id,
}: ConfigSectionProps) {
  return (
    <section id={id} className={cn("scroll-mt-24 space-y-4", className)}>
      <AdminSectionHeader title={title} description={description} actions={actions} />
      {children}
    </section>
  );
}
