UNPKG

@adaptabletools/adaptable-cjs

Version:

Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements

31 lines (30 loc) 1.84 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.TopBar = void 0; const tslib_1 = require("tslib"); const React = tslib_1.__importStar(require("react")); const clsx_1 = tslib_1.__importDefault(require("clsx")); const AdaptableContext_1 = require("../../../AdaptableContext"); const AdaptableIconComponent_1 = require("../../AdaptableIconComponent"); const Flex_1 = require("../../../../components/Flex"); const baseClassName = 'ab-Adaptable-Popup__TopBar'; const TopBar = (props) => { const adaptable = (0, AdaptableContext_1.useAdaptable)(); const applicationIcon = adaptable.api.optionsApi.getUserInterfaceOptions()?.applicationIcon; let icon = React.createElement(React.Fragment, null); const iconClassName = `${baseClassName}__Icon`; if (props.icon === 'ConfigurationIcon') { icon = React.createElement(AdaptableIconComponent_1.AdaptableIconComponent, { iconClassName: iconClassName, icon: { name: 'settings' } }); } else if (props.icon === 'ApplicationIcon' && applicationIcon) { icon = React.createElement(AdaptableIconComponent_1.AdaptableIconComponent, { icon: applicationIcon, iconClassName: iconClassName }); } else if (typeof props.icon === 'object') { icon = React.createElement(AdaptableIconComponent_1.AdaptableIconComponent, { icon: props.icon, iconClassName: iconClassName }); } return (React.createElement(Flex_1.Box, { className: (0, clsx_1.default)(baseClassName, 'twa:font-medium twa:p-3', 'twa:flex twa:flex-row twa:items-center twa:flex-0 twa:gap-2', 'twa:bg-(--ab-dashboard-header__background) twa:text-(--ab-dashboard-header__color)') }, icon, React.createElement(Flex_1.Box, { className: `${baseClassName}__Title` }, props.children))); }; exports.TopBar = TopBar; exports.default = exports.TopBar;