import React, { Component } from "react";
import Switch from "react-switch";
const primaryColor = "#b4b212"
export class SwitchExample extends Component {
  constructor() {
    super();
    this.state = { checked: false };
    this.handleChange = this.handleChange.bind(this);
  }


  handleChange(checked) {
    this.setState({ checked });
  }

  render() {
    const { label, checked = false, onChange = () => { }, disabled } = this.props
    return (
      <label className="inline-flex items-center gap-2 w-fit" >
        {label && <span>{label}</span>}
        <Switch
          onChange={onChange}
          onColor={primaryColor}
          uncheckedIcon={false}
          disabled={disabled}
          // checkedIcon={false}
          // onChange={onChange}
          checked={checked} />
      </label>
    );
  }
}