import React, { useCallback } from "react" import { Slider } from "@/components/ui" import { useAppTranslation } from "@/i18n/TranslationContext" import { VSCodeCheckbox } from "@vscode/webview-ui-toolkit/react" interface DiffSettingsControlProps { diffEnabled?: boolean fuzzyMatchThreshold?: number onChange: (field: "diffEnabled" | "fuzzyMatchThreshold", value: any) => void } export const DiffSettingsControl: React.FC = ({ diffEnabled = true, fuzzyMatchThreshold = 1.0, onChange, }) => { const { t } = useAppTranslation() const handleDiffEnabledChange = useCallback( (e: any) => { onChange("diffEnabled", e.target.checked) }, [onChange], ) const handleThresholdChange = useCallback( (newValue: number[]) => { onChange("fuzzyMatchThreshold", newValue[0]) }, [onChange], ) return (
{t("settings:advanced.diff.label")}
{t("settings:advanced.diff.description")}
{diffEnabled && (
{Math.round(fuzzyMatchThreshold * 100)}%
{t("settings:advanced.diff.matchPrecision.description")}
)}
) }