import React from "react" import { Block } from "baseui/block" import Scrollable from "~/components/Scrollable" import { HexColorPicker } from "react-colorful" import { Delete } from "baseui/icon" import { throttle } from "lodash" import { Box } from 'gestalt' import { HeaderText } from 'geru-components' import { useActiveObject, useEditor } from "@layerhub-io/react" import { colors } from '~/constants/colors' const PRESET_COLORS = colors export default function () { const [color, setColor] = React.useState("#b32aa9") const activeObject = useActiveObject() const editor = useEditor() const updateObjectFill = throttle((color: string) => { if (activeObject) { editor.objects.update({ fill: color }) } setColor(color) }, 100) return ( Санал болгож буй {PRESET_COLORS.map((color, index) => ( updateObjectFill(color)} backgroundColor={color} height={"38px"} key={index} > ))} ) }