@grandlinex/react-components
Version:
26 lines (25 loc) • 982 B
TypeScript
import React from 'react';
import { INames } from '@grandlinex/react-icons';
export type DefaultSearch = (search: string, setSearch: (x: string) => void, setCommand: (x: CommandAction) => void, close: () => void) => SpotlightOption[] | null;
export type CommandSearch = (args: string[], setSearch: (x: string) => void, setCommand: (x: CommandAction) => void, close: () => void) => SpotlightOption[] | null;
export type CommandAction = {
action: CommandSearch;
commandTag: string;
name: string;
icon?: INames;
};
export type SpotlightProps = {
closeFcn: () => void;
defaultSearch?: DefaultSearch;
action?: CommandAction[];
hint?: React.ReactNode;
};
export type SpotlightOption = {
key: string;
optionAction: (() => void) | null;
text: string;
path?: string[];
component?: React.ReactNode;
icon?: INames;
};
export declare function SpotlightModal({ closeFcn, action, defaultSearch, hint, }: SpotlightProps): React.JSX.Element;