import type { Dispatch, SetStateAction } from "react"; import React from "react"; import type { GroupBase, OptionProps } from "react-select"; import { components } from "react-select"; import type { Props } from "react-select"; import { classNames } from "@calcom/lib"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { Select } from "../select"; export type Option = { value: string; label: string; }; const InputOption: React.FC>> = ({ isDisabled, isFocused, isSelected, children, innerProps, className, ...rest }) => { const props = { ...innerProps, }; return ( {children} ); }; type MultiSelectionCheckboxesProps = { options: { label: string; value: string }[]; setSelected: Dispatch>; selected: Option[]; setValue: (s: Option[]) => unknown; }; const MultiValue = ({ index, getValue }: { index: number; getValue: any }) => { const { t } = useLocale(); return <>{!index &&
{t("nr_event_type", { count: getValue().length })}
}; }; export default function MultiSelectCheckboxes({ options, isLoading, selected, setSelected, setValue, className, }: Omit & MultiSelectionCheckboxesProps) { const additonalComponents = { MultiValue }; return (