import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import { FormattedMessage } from 'react-intl';
import { LISTING_STATE_DRAFT } from '../../util/types';
import { ensureListing } from '../../util/data';
import { EditListingFeaturesForm } from '../../forms';
import { ListingLink } from '../../components';
import css from './EditListingFeaturesPanel.css';
const FEATURES_NAME = 'amenities';
const EditListingFeaturesPanel = props => {
const {
rootClassName,
className,
listing,
onSubmit,
onChange,
submitButtonText,
panelUpdated,
updateInProgress,
errors,
} = props;
const classes = classNames(rootClassName || css.root, className);
const currentListing = ensureListing(listing);
const { publicData } = currentListing.attributes;
const isPublished = currentListing.id && currentListing.attributes.state !== LISTING_STATE_DRAFT;
const panelTitle = isPublished ? (