@hhgtech/hhg-components
Version:
Hello Health Group common components
16 lines (15 loc) • 496 B
TypeScript
/// <reference types="react" />
export type SearchOption = {
label: JSX.Element | string;
value: string | number;
icon?: JSX.Element | string;
};
export declare function useDropDownSearch<T, K extends keyof T = any>(keyword: string, key: K, options: Array<T>, mapFunction: (item: T) => T & SearchOption): {
options: (T & {
normalized: string;
})[];
matched: (T & {
normalized: string;
})[];
dropDownOptions: (T & SearchOption)[];
};