Devendra174's picture
Upload folder using huggingface_hub
1e92f2d verified
raw
history blame
954 Bytes
import React, { memo } from 'react'
import { ChartPropertyWithControl, Flavor } from '../../../types'
import { Control, Switch } from '../ui'
import { ControlContext, SwitchControlConfig } from '../types'
interface SwitchControlProps {
id: string
property: ChartPropertyWithControl<SwitchControlConfig>
flavors: Flavor[]
currentFlavor: Flavor
value: boolean
onChange: (value: boolean) => void
context?: ControlContext
}
export const SwitchControl = memo(
({ id, property, flavors, currentFlavor, value, onChange, context }: SwitchControlProps) => {
return (
<Control
id={id}
property={property}
flavors={flavors}
currentFlavor={currentFlavor}
context={context}
>
<Switch id={id} value={value} onChange={onChange} />
&nbsp;&nbsp;&nbsp;
</Control>
)
}
)