import { h } from 'preact'; import PropTypes from 'prop-types'; import { articlePropTypes } from '../../common-prop-types'; import { MinimalProfilePreviewCard } from '../../profilePreviewCards/MinimalProfilePreviewCard'; import { PublishDate } from './PublishDate'; export const Meta = ({ article, organization }) => { const orgArticleIndexClassAbsent = !document.getElementById( 'organization-article-index', ); return (
{organization && orgArticleIndexClassAbsent && ( {`${organization.name} )} {`${article.user.username}
{filterXSS( article.class_name === 'User' ? article.user.username : article.user.name, )} {organization && !document.getElementById('organization-article-index') && ( {' for '} {organization.name} )}
); }; Meta.defaultProps = { organization: null, }; Meta.propTypes = { article: articlePropTypes.isRequired, organization: PropTypes.shape({ name: PropTypes.string.isRequired, profile_image_90: PropTypes.string.isRequired, slug: PropTypes.string.isRequired, }), }; Meta.displayName = 'Meta';