import { FC, useState } from 'react'
import SwitchComponent from '../../../components/Switch'

type Props = {
    id: string,
    value: boolean,
    onChange: (value: boolean, id: string) => void
}


const ChangeQuikAccess: FC<Props> = (props: Props) => {

    const [active, setActive] = useState<boolean>(props.value)

    return (
        <SwitchComponent
            active={active}
            onChange={(value) => {
                props.onChange(value, props.id)
                setActive(value)
            }}
        />
    )
}

export default ChangeQuikAccess