fix: remove unused event prop

This commit is contained in:
yassinedorbozgithub 2024-11-27 06:37:19 +01:00
parent 638b405bb0
commit fd1e23127e
2 changed files with 4 additions and 10 deletions

View File

@ -32,10 +32,7 @@ import { INlpValue } from "@/types/nlp-value.types";
type NlpPatternSelectProps = { type NlpPatternSelectProps = {
patterns: NlpPattern[]; patterns: NlpPattern[];
onChange: ( onChange: (patterns: NlpPattern[]) => void;
_event: SyntheticEvent<Element, Event> | undefined,
patterns: NlpPattern[],
) => void;
}; };
const NlpPatternSelect = ( const NlpPatternSelect = (
@ -76,7 +73,7 @@ const NlpPatternSelect = (
), ),
]; ];
onChange(undefined, newSelection); onChange(newSelection);
}; };
const handleNlpValueChange = ( const handleNlpValueChange = (
{ id, name }: Pick<INlpEntity, "id" | "name">, { id, name }: Pick<INlpEntity, "id" | "name">,
@ -102,7 +99,7 @@ const NlpPatternSelect = (
update.value = value.value; update.value = value.value;
} }
onChange(undefined, newSelection); onChange(newSelection);
}; };
if (!options.length) { if (!options.length) {
@ -255,7 +252,6 @@ const NlpPatternSelect = (
onDelete(e); onDelete(e);
onChange( onChange(
undefined,
patterns.filter((p) => p.entity !== name), patterns.filter((p) => p.entity !== name),
); );
}} }}

View File

@ -148,9 +148,7 @@ const PatternInput: FC<PatternInputProps> = ({
{patternType === "nlp" && ( {patternType === "nlp" && (
<NlpPatternSelect <NlpPatternSelect
patterns={pattern as NlpPattern[]} patterns={pattern as NlpPattern[]}
onChange={(_e, data) => { onChange={setPattern}
setPattern(data);
}}
/> />
)} )}
{patternType === "menu" ? ( {patternType === "menu" ? (