import React from 'react'; import compareId from 'soapbox/compare_id'; import { HStack } from 'soapbox/components/ui'; import Color from './color'; interface ColorGroup { [tint: string]: string, } interface IPalette { palette: ColorGroup, onChange: (palette: ColorGroup) => void, } /** Editable color palette. */ const Palette: React.FC = ({ palette, onChange }) => { const tints = Object.keys(palette).sort(compareId); const handleChange = (tint: string) => { return (color: string) => { onChange({ ...palette, [tint]: color, }); }; }; return ( {tints.map(tint => ( ))} ); }; export { Palette as default, ColorGroup, };