import type { ReactNode } from 'react';
import type { Character } from '@/lib/schemas';

/** Shared props for every character-sheet section. `update` merges a shallow patch. */
export interface SectionProps {
  c: Character;
  update: (patch: Partial<Character>) => void;
}

export function SheetSection({
  title,
  actions,
  children,
}: {
  title: string;
  actions?: ReactNode;
  children: ReactNode;
}) {
  return (
    <section className="mb-6">
      <div className="mb-2 flex items-center justify-between">
        <h2 className="font-display text-lg font-semibold text-ink">{title}</h2>
        {actions}
      </div>
      {children}
    </section>
  );
}
