"use client"; import { useRef } from "react"; import { EyeOff, Scaling, Type } from "lucide-react"; import type { FrameLabelMode } from "@/lib/canvas-elements"; import styles from "./canvas.module.css"; const options = [ { value: "hidden", label: "隐藏名称", hint: "在画布上隐藏分区名称", Icon: EyeOff }, { value: "fixed", label: "固定字号", hint: "缩放画布时保持名称大小", Icon: Type }, { value: "scaled", label: "随画布缩放", hint: "名称随画布一起放大缩小", Icon: Scaling }, ] as const; export function FrameLabelMenu({ value, change }: { value: FrameLabelMode; change: (mode: FrameLabelMode) => void }) { const items = useRef<(HTMLButtonElement | null)[]>([]); const current = Math.max(0, options.findIndex((option) => option.value === value)); return