--- import { capitalize } from '@shared/lib/string-format' interface Props { type?: 'checkbox' | 'radio' checked?: boolean disabled?: boolean /** Switch mode (prop name isSwitch; `switch` is reserved). */ switch?: boolean title?: string | false name?: string inline?: boolean size?: string empty?: boolean titleOn?: string titleOff?: string class?: string } const { type = 'checkbox', checked = false, disabled = false, switch: isSwitch = false, title: titleProp = false, name, inline, size, empty: isEmpty = false, titleOn, titleOff, class: className } = Astro.props let title = titleProp if (!title) { let t = '' if (disabled) t += ' disabled' if (checked) t += ' checked' if (isSwitch) t += ' switch' t += ' ' + type t += ' input' t = t.replace(/^\s+/, '') t = capitalize(t) title = t } const labelClasses = ['form-check', inline && 'form-check-inline', isSwitch && 'form-switch', isSwitch && size && `form-switch-${size}`, className] const inputClasses = ['form-check-input', isEmpty && 'position-static'] ---