diff --git a/hivemq-edge/src/frontend/src/components/MQTT/EntityCreatableSelect.tsx b/hivemq-edge/src/frontend/src/components/MQTT/EntityCreatableSelect.tsx index b8cba4410c..7669555709 100644 --- a/hivemq-edge/src/frontend/src/components/MQTT/EntityCreatableSelect.tsx +++ b/hivemq-edge/src/frontend/src/components/MQTT/EntityCreatableSelect.tsx @@ -104,7 +104,7 @@ const EntityCreatableSelect: FC = ({ const { t } = useTranslation('components') const safeValue = useMemo(() => { if (value === null) return null - if (isMulti) return (value as MultiValue).map((w: string) => ({ label: w, value: w })) + if (isMulti) return (value as MultiValue).map((value: string) => ({ label: value, value })) return { label: value as string, value: value as string } }, [isMulti, value]) const safeOnChange = useCallback( @@ -114,7 +114,7 @@ const EntityCreatableSelect: FC = ({ return } if (isMulti) { - onChange((value as MultiValue).map((w) => w.value)) + onChange((value as MultiValue).map((option) => option.value)) return } @@ -165,9 +165,9 @@ interface CreateSelectableProps { export const SelectTopic: FC = (props) => { const { data, isLoading } = useGetEdgeTopics({ publishOnly: false }) const options = - data.map((e) => ({ - label: e, - value: e, + data.map((topic) => ({ + label: topic, + value: topic, })) || [] return ( @@ -184,10 +184,10 @@ export const SelectTopic: FC = (props) => { export const SelectTopicFilter: FC = (props) => { const { data, isLoading } = useListTopicFilters() const options = - data?.items?.map((e) => ({ - label: e.topicFilter, - value: e.topicFilter, - description: e.description, + data?.items?.map((filter) => ({ + label: filter.topicFilter, + value: filter.topicFilter, + description: filter.description, })) || [] return ( @@ -207,7 +207,7 @@ interface TagSelectProps extends CreateSelectableProps { export const SelectTag: FC = ({ adapterId, ...rest }) => { const { data, isLoading } = useGetDomainTags(adapterId) - const options = data?.items?.map((e) => ({ label: e.tag, value: e.tag })) || [] + const options = data?.items?.map((tag) => ({ label: tag.tag, value: tag.tag })) || [] return (