[fix review issue]: update setting name

This commit is contained in:
duanfuxiang
2025-02-17 19:07:33 +08:00
parent 173f2b7fa5
commit dc520535fc
22 changed files with 721 additions and 1269 deletions

View File

@@ -0,0 +1,46 @@
import * as React from "react";
import { InfioSettings } from '../../types/settings';
import {
MAX_DELAY,
MIN_DELAY,
} from "../versions";
import SliderSettingsItem from "./SliderSettingsItem";
import TriggerSettings from "./TriggerSettings";
type Props = {
settings: InfioSettings;
updateSettings: (update: Partial<InfioSettings>) => void;
errors: Map<string, string>;
}
export default function TriggerSettingsSection({ settings, updateSettings, errors }: Props): React.JSX.Element {
return (
<>
<SliderSettingsItem
name={"Delay"}
description={
"Delay in ms between the last character typed and the completion request."
}
value={settings.delay}
errorMessage={errors.get("delay")}
setValue={(value: number) => updateSettings({ delay: value })}
min={MIN_DELAY}
max={MAX_DELAY}
step={100}
suffix={"ms"}
/>
<TriggerSettings
name={"Trigger words"}
description={
"Completions will be triggered if the text before the matches any of these words or characters. This can either be a direct string match or a regex match. When using a regex, make sure to include the end of line character ($)."
}
triggers={settings.triggers}
setValues={(triggers) => updateSettings({ triggers })}
errorMessage={errors.get("triggerWords")}
errorMessages={errors}
/>
</>
);
}