text: import React from 'react';
  import sortBy from 'lodash/sortBy';
  import { FormattedMessage } from '../../util/reactIntl';
  import { PropertyGroup } from '../../components';
  
  import css from './ListingPage.css';
  
  const SectionFeaturesMaybe = props => {
    const { options, publicData } = props;
    if (!publicData) {
      return null;
    }
  
    const selectedOptions = publicData && publicData.amenities ? publicData.amenities : [];
    const selectedOptionsFull = options.filter(opt => selectedOptions.includes(opt.key));
  
    return (
      <div className={css.sectionFeatures}>
        <h2 className={css.featuresTitle}>
          <FormattedMessage id="ListingPage.featuresTitle" />
        </h2>
        <PropertyGroup
          id="ListingPage.amenities"
          options={sortBy(selectedOptionsFull, 'label')}
          selectedOptions={selectedOptions}
          twoColumns={true}
        />
      </div>
    );
  };
  
  export default SectionFeaturesMaybe;
  