import { ButtonBase, Popover } from "@mui/material"; import { startTransition, useState } from "react"; import { HexAlphaColorPicker } from "react-colorful"; interface Props { color: string; onChange: (color: string) => void; } export default function CircleColorPicker({ color, onChange }: Props) { const [anchorEl, setAnchorEl] = useState(null); return ( <> setAnchorEl(event.currentTarget)} sx={{ aspectRatio: 1, height: "22px", width: "22px", minWidth: "22px", borderRadius: "50%", backgroundColor: color, border: "1px solid #4D4D4D", }} /> setAnchorEl(null)} anchorOrigin={{ vertical: "bottom", horizontal: "right", }} slotProps={{ paper: { sx: { p: "20px", }, style: { backgroundColor: color, }, }, }} > startTransition(() => onChange(color))} /> ); }