fix(clipboard): add shared helper and remove lint warnings

This commit is contained in:
Supra4E8C
2026-02-14 03:33:09 +08:00
parent 3a7ddfdff1
commit bf824f8561

View File

@@ -409,7 +409,7 @@ function PayloadRulesEditor({
protocolFirst?: boolean;
onChange: (next: PayloadRule[]) => void;
}) {
const { t, i18n } = useTranslation();
const { t } = useTranslation();
const rules = value.length ? value : [];
const protocolOptions = useMemo(
() =>
@@ -417,7 +417,7 @@ function PayloadRulesEditor({
value: option.value,
label: t(option.labelKey, { defaultValue: option.defaultLabel }),
})),
[t, i18n.resolvedLanguage]
[t]
);
const payloadValueTypeOptions = useMemo(
() =>
@@ -425,7 +425,7 @@ function PayloadRulesEditor({
value: option.value,
label: t(option.labelKey, { defaultValue: option.defaultLabel }),
})),
[t, i18n.resolvedLanguage]
[t]
);
const addRule = () => onChange([...rules, { id: makeClientId(), models: [], params: [] }]);
@@ -668,7 +668,7 @@ function PayloadFilterRulesEditor({
disabled?: boolean;
onChange: (next: PayloadFilterRule[]) => void;
}) {
const { t, i18n } = useTranslation();
const { t } = useTranslation();
const rules = value.length ? value : [];
const protocolOptions = useMemo(
() =>
@@ -676,7 +676,7 @@ function PayloadFilterRulesEditor({
value: option.value,
label: t(option.labelKey, { defaultValue: option.defaultLabel }),
})),
[t, i18n.resolvedLanguage]
[t]
);
const addRule = () => onChange([...rules, { id: makeClientId(), models: [], params: [] }]);