/**
 * Shared prop types for settings section components.
 *
 * Every section component receives the full localized settings payload so it
 * can pull out whatever it needs (select options, feature flags, etc.).
 * The `sectionKey` prop is the key of the currently active section.
 */

import type { SettingsSelectOption as BaseSettingsSelectOption } from '@pdfdraft/core/components';

export interface SettingsSelectOption extends BaseSettingsSelectOption {
	description?: string;
}

export interface SectionProps {
	/** The key of this section as registered in PHP. */
	sectionKey: string;

	/** Full localized payload from PHP — sections pull what they need. */
	localizedData: Record<string, unknown>;

	// ── Invoice-specific state passed down from the parent page ──────────────

	currentMode: 'automatic' | 'manual';
	disableFreeOrderInvoices: boolean;
	onDisableFreeOrderInvoicesChange: (value: boolean) => void;
	currentInvoiceNumberMode: 'order_id' | 'sequential';
	localInvoiceNumberStart: string;
	onGenerationModeChange: (value: string) => void;
	onInvoiceNumberModeChange: (value: string) => void;
	onInvoiceNumberStartChange: (value: string) => void;
	showMyAccountDownloadButton: boolean;
	onMyAccountDownloadButtonChange: (value: boolean) => void;
	invoicePrefix: string;
	invoiceSuffix: string;
	onInvoicePrefixChange: (value: string) => void;
	onInvoiceSuffixChange: (value: string) => void;
	storageCustomFolder: string;
	storageOrganizeByDate: boolean;
	onStorageCustomFolderChange: (value: string) => void;
	onStorageOrganizeByDateChange: (value: boolean) => void;
	generationModeOptions: SettingsSelectOption[];
	invoiceNumberModeOptions: SettingsSelectOption[];

	// ── Invoice template selection ───────────────────────────────────────────
	activeDesignSlug: string;
	onActiveDesignSlugChange: (slug: string) => void;
}
