import PropTypes from 'prop-types'; import { h } from 'preact'; import { listingPropTypes } from './listingPropTypes'; const LocationText = ({ location }) => { return location ? ( ・{location} ) : ( '' ); }; LocationText.propTypes = { location: PropTypes.string, }; LocationText.defaultProps = { location: null, }; export const AuthorInfo = ({ listing, onCategoryClick }) => { const { category, location, author = {} } = listing; const { username, name, profile_image_90 } = author; return (
{name}
{name}

onCategoryClick(e, category)} data-no-instant className="crayons-link crayons-link--secondary" > {category}

); }; AuthorInfo.propTypes = { listing: listingPropTypes.isRequired, onCategoryClick: PropTypes.func, }; AuthorInfo.defaultProps = { onCategoryClick: () => {}, };