UNPKG

@etsoo/materialui

Version:

TypeScript Material-UI Implementation

25 lines (24 loc) 802 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SelectBool = SelectBool; const jsx_runtime_1 = require("react/jsx-runtime"); const shared_1 = require("@etsoo/shared"); const SelectEx_1 = require("./SelectEx"); const ReactApp_1 = require("./app/ReactApp"); /** * SelectBool (yes/no) * @param props Props * @returns Component */ function SelectBool(props) { // Global app const app = (0, ReactApp_1.useAppContext)(); // Destruct const { search = true, autoAddBlankItem = search, ...rest } = props; // Options const options = app?.getBools() ?? []; if (autoAddBlankItem) shared_1.Utils.addBlankItem(options); // Layout return (0, jsx_runtime_1.jsx)(SelectEx_1.SelectEx, { options: options, search: search, ...rest }); }