import React, { useState, CSSProperties } from "react"; import Select, { ValueType, Props } from "react-select"; import CreatableSelect from "react-select/creatable"; import { debounce } from "lodash"; import * as GQL from "src/core/generated-graphql"; import { useAllTagsForFilter, useAllMoviesForFilter, useAllStudiosForFilter, useAllPerformersForFilter, useMarkerStrings, useScrapePerformerList, useTagCreate, useStudioCreate, usePerformerCreate, useFindGalleries, } from "src/core/StashService"; import { useToast } from "src/hooks"; import { ListFilterModel } from "src/models/list-filter/filter"; import { FilterMode } from "src/models/list-filter/types"; export type ValidTypes = | GQL.SlimPerformerDataFragment | GQL.Tag | GQL.SlimStudioDataFragment | GQL.SlimMovieDataFragment; type Option = { value: string; label: string }; interface ITypeProps { type?: | "performers" | "studios" | "parent_studios" | "tags" | "sceneTags" | "movies"; } interface IFilterProps { ids?: string[]; initialIds?: string[]; onSelect?: (item: ValidTypes[]) => void; noSelectionString?: string; className?: string; isMulti?: boolean; isClearable?: boolean; isDisabled?: boolean; } interface ISelectProps { className?: string; items: Option[]; selectedOptions?: Option[]; creatable?: boolean; onCreateOption?: (value: string) => void; isLoading: boolean; isDisabled?: boolean; onChange: (item: ValueType