@ui5/webcomponents-react
Version:
React Wrapper for UI5 Web Components and additional components
23 lines • 674 B
JavaScript
import { forwardRef, isValidElement } from 'react';
import { Title } from '../../../webComponents/Title/index.js';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
const styles = {
minHeight: '1.5rem',
display: 'flex',
alignItems: 'center'
};
export const TitleBar = /*#__PURE__*/forwardRef((props, ref) => {
const {
children,
titleBarId
} = props;
return /*#__PURE__*/_jsxs("div", {
style: styles,
ref: ref,
id: titleBarId,
children: [typeof children === 'string' && /*#__PURE__*/_jsx(Title, {
children: children
}), /*#__PURE__*/isValidElement(children) && children]
});
});
TitleBar.displayName = 'TitleBar';