import React from "react"; import styles from "./itemSelect.module.css" export interface SelectItemIE{ name:string value: string|number } interface SelectIE{ onChange: (value:string|number) => void items: SelectItemIE[] value?:number } export const ItemSelect: React.FC = (props) =>{ let options = new Array() props.items.map((item:SelectItemIE)=>{ options.push( ) }) const getValue = (name:string) =>{ let val; props.items.map((item:SelectItemIE) => { if (item.name == name){ val = item.value } }) return val } const getName = (value:number) =>{ let name; props.items.map((item:SelectItemIE) => { if (item.value == value){ name = item.name } }) return name } return(
{ props.value == undefined? : }
) }