mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2025-07-31 02:00:07 +02:00

Add initial components for new editor settings modal GitOrigin-RevId: e3eb511d2af9265e0fc1cf54178b3e2953717950
34 lines
674 B
TypeScript
34 lines
674 B
TypeScript
import Setting from './setting'
|
|
import OLFormSwitch from '@/features/ui/components/ol/ol-form-switch'
|
|
|
|
export default function ToggleSetting({
|
|
id,
|
|
label,
|
|
description,
|
|
checked,
|
|
onChange,
|
|
disabled,
|
|
}: {
|
|
id: string
|
|
label: string
|
|
description: string
|
|
checked: boolean | undefined
|
|
onChange: (newValue: boolean) => void
|
|
disabled?: boolean
|
|
}) {
|
|
const handleChange = () => {
|
|
onChange(!checked)
|
|
}
|
|
|
|
return (
|
|
<Setting controlId={id} label={label} description={description}>
|
|
<OLFormSwitch
|
|
id={id}
|
|
onChange={handleChange}
|
|
checked={checked}
|
|
label={label}
|
|
disabled={disabled}
|
|
/>
|
|
</Setting>
|
|
)
|
|
}
|