/* eslint-disable no-param-reassign */ import React from 'react'; import { CustomPicker } from 'react-color'; import { EditableInput, Hue, Saturation, } from 'react-color/lib/components/common'; import Button from '../Button'; import { Wrapper, HueWrapper, SaturationWrapper, Label, InputWrapper, Swatch, } from './styled'; type Props = { hex: string; hsl: unknown; hsv: unknown; onChange: (info: ColorType) => void; onSubmit: (color: unknown) => void; }; const ColorPicker: React.FC = ({ hex, hsl, hsv, onChange, onSubmit, }: Props) => { const styles = { input: { height: 28, width: '80px', border: `1px solid white`, color: 'white', backgroundColor: 'transparent', paddingLeft: 10, borderRadius: '4px', }, }; const handleClick = () => { onSubmit({ hex, hsl, hsv }); }; return ( ); }; const areEqual = ( prevProps: Record, nextProps: Record, ) => { if (prevProps.color !== nextProps.color) { return false; } return true; }; export default React.memo(CustomPicker(ColorPicker), areEqual);