import React from "react" import * as antd from "antd" import { Translation } from "react-i18next" import { SelectableList, Skeleton } from "components" import { debounce } from "lodash" import fuse from "fuse.js" import "./index.less" export default class UserSelector extends React.Component { state = { loading: true, data: [], searchValue: null, } api = window.app.api.withEndpoints("main") componentDidMount = async () => { this.toogleLoading(true) await this.fetchUsers() } toogleLoading = (to) => { this.setState({ loading: to ?? !this.state.loading }) } fetchUsers = async () => { const data = await this.api.get.users(undefined, { select: this.props.select }).catch((err) => { console.error(err) antd.message.error("Error fetching operators") }) this.setState({ data: data, loading: false }) } isExcludedId = (id) => { if (this.props.excludedIds) { return this.props.excludedIds.includes(id) } return false } renderItem = (item) => { return