/**
 * Client-side settings section registry.
 *
 * Maps a section key (defined in PHP via SectionInterface::getKey()) to its
 * React component. The PHP layer controls which sections appear in the sidebar
 * and in what order — this file only needs to know how to render each one.
 *
 * To add a new section:
 *   1. Create the component in ./sections/<your-key>.tsx
 *   2. Import it here and add it to SECTION_COMPONENTS.
 */

import type { ComponentType, ElementType } from 'react';
import type { SectionProps } from './types';
import { InvoicesSection } from './invoices';
import { LayoutGrid } from '@pdfdraft/ui/icons';

/**
 * Map of section key → React component.
 * Each component receives the full SectionProps so it can read/write settings.
 */
export const SECTION_COMPONENTS: Record<string, ComponentType<SectionProps>> = {
	invoices: InvoicesSection,
};

/**
 * Map of section key → sidebar icon component.
 * Falls back to LayoutGrid if a key has no explicit icon.
 */
export const SECTION_ICONS: Record<string, ElementType> = {
	invoices: LayoutGrid,
};
