overleaf/services/web/frontend/js/shared/components/switch.tsx
Miguel Serrano d94eaa19cc Merge pull request #14587 from overleaf/mf-enable-sso-managed-users
[web] Enable SSO switch on Group Settings

GitOrigin-RevId: 591881eb4e6bad912de026f7a687f3b020712c2d
2023-10-02 08:04:18 +00:00

26 lines
561 B
TypeScript

import classNames from 'classnames'
type SwitchProps = {
onChange: () => void
checked: boolean
disabled?: boolean
}
function Switch({ onChange, checked, disabled = false }: SwitchProps) {
return (
<label className={classNames('switch-input', { disabled })}>
<input
className="invisible-input"
type="checkbox"
role="switch"
autoComplete="off"
onChange={onChange}
checked={checked}
disabled={disabled}
/>
<span className="switch" />
</label>
)
}
export default Switch