mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-03 06:09:02 +02:00
213b645875
Update editor switching behaviour for new user split test GitOrigin-RevId: 61ef678ba216323d283bda4cc77d8c465b8c87df
36 lines
704 B
TypeScript
36 lines
704 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: 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>
|
|
)
|
|
}
|