import React from 'react' import { Select, Toggle, FormGroup } from './bootstrap' import { PdfExportOptions } from './PdfExportOptions' interface PdfExportOptionsFormProps { /** Current options */ options: PdfExportOptions /** Called when any option changes */ onChange: (options: PdfExportOptions) => void /** If true, form inputs are disabled */ disabled?: boolean } /** * Form component for PDF export options. * Pure UI component with no side effects or job management logic. */ export function PdfExportOptionsForm(props: PdfExportOptionsFormProps) { const { options, onChange, disabled } = props const handleOptionChange = (key: K, value: PdfExportOptions[K]) => { onChange({ ...options, [key]: value }) } const commonInputStyle: React.CSSProperties = disabled ? { pointerEvents: "none", opacity: 0.5 } : {} return ( <>
handleOptionChange("margins", Number(value))} options={[ { value: 0.5, label: T`Standard (0.5 in/12.7 mm)` }, { value: 0.25, label: T`Narrow (0.25 in/6.35 mm)` }, { value: 1.0, label: T`Large (1.0 in/25.4 mm)` }, { value: 0, label: T`None` } ]} />