import { SliderPicker } from "react-color";
//To be used as a form element only.

const ColorPickerFormItem = ({ value, onChange, style, ...restProps }) => {
  const handleChangeComplete = (color) => {
    if (onChange) onChange(color);
  };

  return (
    <SliderPicker
      {...restProps}
      style={{ width: "100%", ...style }}
      color={value}
      triangle="hide"
      onChangeComplete={handleChangeComplete}
    />
  );
};
export default ColorPickerFormItem;
