UNPKG

react-ttsx

Version:

This package provides a set of reusable React components, including buttons, alerts, and spinners, to help you quickly build and style your React applications. The components are designed to be highly customizable and easy to integrate into your projects.

30 lines (29 loc) 937 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.PopoverType = void 0; exports.TypeofPopover = TypeofPopover; var PopoverType; (function (PopoverType) { PopoverType[PopoverType["spinner"] = 1] = "spinner"; })(PopoverType || (exports.PopoverType = PopoverType = {})); function TypeofPopover(type) { if (typeof type === 'number') { for (const key in PopoverType) { if (PopoverType[key] === type && typeof key === 'string') { return key; } } throw new Error('Error: Number type not found in PopoverType enum'); } else if (typeof type === 'string') { if (PopoverType[type] !== undefined) { return PopoverType[type]; } else { throw new Error('Error: String type not found in PopoverType enum'); } } else { throw new Error('Error: Invalid type'); } }