// Copyright (C) 2020 Intel Corporation // // SPDX-License-Identifier: MIT import React from 'react'; import Select, { SelectProps } from 'antd/lib/select'; // eslint-disable-next-line import/no-extraneous-dependencies import { OptionData, OptionGroupData } from 'rc-select/lib/interface'; interface Props extends SelectProps { labels: any[]; value: any | number | null; onChange: (label: any) => void; } export default function LabelSelector(props: Props): JSX.Element { const { labels, value, onChange, ...rest } = props; const dinamicProps = value ? { value: typeof value === 'number' ? value : value.id, } : {}; return ( ); }