import { ButtonBase } from "@mui/material"; import { startTransition, useRef } from "react"; interface Props { color: string; onChange: (color: string) => void; } export default function CircleColorPicker({ color, onChange }: Props) { const inputRef = useRef(null); return ( inputRef.current?.click()} sx={{ aspectRatio: 1, height: "22px", width: "22px", minWidth: "20px", borderRadius: "50%", backgroundColor: color, border: "1px solid #4D4D4D", }} > { startTransition(() => { onChange(e.target.value); }); }} style={{ opacity: 0, cursor: "pointer", }} /> ); }