import React, {useState} from 'react' import {RadioGroup} from '@headlessui/react' import {COLORS, rgbToHex} from "../src/colors"; interface ColorsProps { initialValue: COLORS, onChange(value: COLORS): void; } function Colors(props: ColorsProps): JSX.Element { let [color, setColor] = useState(props.initialValue) return ( className="flex flex-wrap" value={color} onChange={function (value) { setColor(value); props.onChange(value); } }> {Object.values(COLORS).map((color) => { return ( {({checked}) => (
{checked && }
)}
) })} ) } export default Colors;