import React, { Component, useState } from 'react'
import Select, { OnChangeValue } from 'react-select'
import { playerOptions } from '../../options/app.interface'
import './multiSelectStyles.css'
const options:playerOptions[] = [
]
export const MultiSeclect = () => {
const [currentPlayer, setCurrentPlayer] = useState<any>([])
const getValue = () =>{
return currentPlayer
?options.filter( player => currentPlayer.indexOf( player.value) >= 0)
:[]
}
const onChange = (newValue:OnChangeValue<playerOptions,boolean>) =>{
setCurrentPlayer(
(newValue as playerOptions[]).map((v)=> v.value)
)
}
return(
<Select
classNamePrefix='custom-select'
onChange={onChange}
value={getValue()}
options={options}
isMulti/>
)
}
Дали данные на Swagger UI
dev.trainee.dex-it.ru/swagger/index.html, не знаю как им пользоваться, подскажите как получить данные и передать их в массив?