scripts/core/ui/components/Popup/Label.tsx
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import {gettext} from 'core/utils';
/**
* @ngdoc react
* @name Label
* @description Label used in a popup, typically in header
*/
const Label: React.StatelessComponent<any> = ({text, children, centerText}) => (
<span
className={classNames(
'popup__menu-label',
{'popup__menu-label--center': centerText},
)}
>
{gettext(text)}
{children}
</span>
);
Label.propTypes = {
text: PropTypes.string,
children: PropTypes.node,
centerText: PropTypes.bool,
};
Label.defaultProps = {centerText: false};
export default Label;