import React from 'react'; import PropTypes from 'prop-types'; import './ChannelIntro.scss'; import Linkify from 'linkifyjs/react'; import colorMXID from '../../../util/colorMXID'; import Text from '../../atoms/text/Text'; import Avatar from '../../atoms/avatar/Avatar'; function linkifyContent(content) { return {content}; } function ChannelIntro({ roomId, avatarSrc, name, heading, desc, time, }) { return (
{heading} {linkifyContent(desc)} { time !== null && {time}}
); } ChannelIntro.defaultProps = { avatarSrc: false, time: null, }; ChannelIntro.propTypes = { roomId: PropTypes.string.isRequired, avatarSrc: PropTypes.oneOfType([ PropTypes.string, PropTypes.bool, ]), name: PropTypes.string.isRequired, heading: PropTypes.string.isRequired, desc: PropTypes.string.isRequired, time: PropTypes.string, }; export default ChannelIntro;