import React, { useState, useCallback } from "react"; import Select, { ValueType } from "react-select"; import CreatableSelect from "react-select/creatable"; import { debounce } from "lodash"; import * as GQL from "src/core/generated-graphql"; import { StashService } from "src/core/StashService"; import { useToast } from "src/hooks"; type ValidTypes = | GQL.SlimPerformerDataFragment | GQL.Tag | GQL.SlimStudioDataFragment; type Option = { value: string; label: string }; interface ITypeProps { type?: "performers" | "studios" | "tags"; } interface IFilterProps { ids?: string[]; initialIds?: string[]; onSelect: (item: ValidTypes[]) => void; noSelectionString?: string; className?: string; isMulti?: boolean; isClearable?: boolean; } interface ISelectProps { className?: string; items: Option[]; selectedOptions?: Option[]; creatable?: boolean; onCreateOption?: (value: string) => void; isLoading: boolean; onChange: (item: ValueType