import { Popover } from "antd"; import { SlidersHorizontal } from "lucide-react"; import { canvasThemes } from "@/lib/canvas-theme"; import { PORTRAIT_TEXTURE_GROUPS, normalizePortraitTextureSettings, type PortraitTextureSettingKey, type PortraitTextureSettings, } from "@/lib/canvas/canvas-portrait-texture"; import { useActiveTheme } from "@/stores/canvas/use-canvas-theme-store"; type CanvasPortraitTexturePopoverProps = { value: unknown; placement?: "topLeft" | "topRight"; onChange: (settings: PortraitTextureSettings) => void; }; export function CanvasPortraitTexturePopover({ value, placement = "topLeft", onChange }: CanvasPortraitTexturePopoverProps) { const theme = canvasThemes[useActiveTheme()]; const settings = normalizePortraitTextureSettings(value); const updateSetting = (key: PortraitTextureSettingKey, nextValue: string) => { onChange(normalizePortraitTextureSettings({ ...settings, [key]: nextValue })); }; const content = (
质感调整
{PORTRAIT_TEXTURE_GROUPS.map((group) => (
{group.label}
{group.options.map((option) => { const selected = settings[group.key] === option.value; return ( ); })}
))}
); return ( ); }