@adaptabletools/adaptable
Version:
Powerful AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements
24 lines (23 loc) • 1.51 kB
JavaScript
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { useAdaptable } from '../../../AdaptableContext';
import { AdaptableIconComponent } from '../../AdaptableIconComponent';
import { Box } from '../../../../components/Flex';
import { cn } from '../../../../lib/utils';
const baseClassName = 'ab-Adaptable-Popup__TopBar';
export const TopBar = (props) => {
const adaptable = useAdaptable();
const applicationIcon = adaptable.api.optionsApi.getUserInterfaceOptions()?.applicationIcon;
let icon = _jsx(_Fragment, {});
const iconClassName = `${baseClassName}__Icon`;
if (props.icon === 'ConfigurationIcon') {
icon = _jsx(AdaptableIconComponent, { iconClassName: iconClassName, icon: { name: 'settings' } });
}
else if (props.icon === 'ApplicationIcon' && applicationIcon) {
icon = _jsx(AdaptableIconComponent, { icon: applicationIcon, iconClassName: iconClassName });
}
else if (typeof props.icon === 'object') {
icon = _jsx(AdaptableIconComponent, { icon: props.icon, iconClassName: iconClassName });
}
return (_jsxs(Box, { className: cn(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)', 'twa:rounded-tl-standard twa:rounded-tr-standard'), children: [icon, _jsx(Box, { className: `${baseClassName}__Title`, children: props.children })] }));
};
export default TopBar;