UNPKG

@etsoo/materialui

Version:

TypeScript Material-UI Implementation

22 lines (21 loc) 671 B
import { jsx as _jsx } from "react/jsx-runtime"; import { Utils } from "@etsoo/shared"; import { SelectEx } from "./SelectEx"; import { useAppContext } from "./app/ReactApp"; /** * SelectBool (yes/no) * @param props Props * @returns Component */ export function SelectBool(props) { // Global app const app = useAppContext(); // Destruct const { search = true, autoAddBlankItem = search, value, ...rest } = props; // Options const options = app?.getBools() ?? []; if (autoAddBlankItem) Utils.addBlankItem(options); // Layout return (_jsx(SelectEx, { options: options, search: search, value: `${value ?? ""}`, ...rest })); }