mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-25 10:10:08 +02:00
Tearing down of old Editor (Settings) GitOrigin-RevId: d9e23e61a8e34eb22e9c9e3453a157fb275f68f0
36 lines
713 B
TypeScript
36 lines
713 B
TypeScript
import React from 'react'
|
|
import Setting from './setting'
|
|
import OLFormSwitch from '@/shared/components/ol/ol-form-switch'
|
|
|
|
export default function ToggleSetting({
|
|
id,
|
|
label,
|
|
description,
|
|
checked,
|
|
onChange,
|
|
disabled,
|
|
}: {
|
|
id: string
|
|
label: React.ReactNode
|
|
description: React.ReactNode
|
|
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>
|
|
)
|
|
}
|