mirror of
https://github.com/HSLdevcom/digitransit-ui
synced 2025-07-27 15:05:15 +02:00
37 lines
855 B
JavaScript
37 lines
855 B
JavaScript
import PropTypes from 'prop-types';
|
|
import React from 'react';
|
|
import { intlShape } from 'react-intl';
|
|
|
|
const PopupHeader = ({ header, subHeader, children }, { intl }) => {
|
|
return (
|
|
<div className="location-popup-wrapper">
|
|
<div className="location-address">{header}</div>
|
|
{(children || subHeader) && (
|
|
<div className="location-place">
|
|
{!subHeader
|
|
? intl.formatMessage({ id: 'zone', defaultMessage: 'Zone' })
|
|
: subHeader}
|
|
{children}
|
|
</div>
|
|
)}
|
|
</div>
|
|
);
|
|
};
|
|
|
|
PopupHeader.propTypes = {
|
|
header: PropTypes.string,
|
|
subHeader: PropTypes.string,
|
|
children: PropTypes.node,
|
|
};
|
|
|
|
PopupHeader.defaultProps = {
|
|
header: undefined,
|
|
subHeader: undefined,
|
|
children: undefined,
|
|
};
|
|
|
|
PopupHeader.contextTypes = {
|
|
intl: intlShape.isRequired,
|
|
};
|
|
|
|
export default PopupHeader;
|