import { type ReactNode } from "react"; import { useTranslation } from "react-i18next"; import i18n from "@/i18n"; import { ImageSettingsTheme } from "@/components/image-settings-panel"; import { type CanvasTheme } from "@/lib/canvas-theme"; import type { AiConfig, ReasoningEffort } from "@/stores/use-config-store"; const reasoningEffortOptions: ReasoningEffort[] = ["auto", "low", "medium", "high", "xhigh"]; type TextSettingsPanelProps = { config: AiConfig; onConfigChange: (key: "reasoningEffort", value: ReasoningEffort) => void; theme: CanvasTheme; className?: string; }; export function TextSettingsPanel({ config, onConfigChange, theme, className = "space-y-4" }: TextSettingsPanelProps) { const { t } = useTranslation(); return ( event.stopPropagation()}> {t("settingsPanels.text.title")} {t("settingsPanels.text.reasoning")} {reasoningEffortOptions.map((value) => ( onConfigChange("reasoningEffort", value)}> {t(`settingsPanels.common.${value}`)} ))} ); } export function reasoningEffortLabel(value: ReasoningEffort) { return reasoningEffortOptions.includes(value) ? i18n.t(`settingsPanels.common.${value}`) : value; } function OptionPill({ selected, theme, onClick, children }: { selected: boolean; theme: CanvasTheme; onClick: () => void; children: ReactNode }) { return ( event.stopPropagation()} onClick={onClick} > {children} ); }