/* * NOTE: * This component should be put in the strapi-helper-plugin * at some point so the other packages can benefits from the updates * * */ import React, { Fragment } from 'react'; import PropTypes from 'prop-types'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { HeaderModalTitle } from 'strapi-helper-plugin'; import ModalSection from '../ModalSection'; import Text from '../Text'; import BackButton from './BackButton'; import Wrapper from './Wrapper'; const ModalHeader = ({ goBack, headers, withBackButton }) => { return ( {withBackButton && } {headers.map(({ key, element }, index) => { const shouldDisplayChevron = index < headers.length - 1; return ( {element} {shouldDisplayChevron && ( )} ); })} ); }; ModalHeader.defaultProps = { goBack: () => {}, headers: [], withBackButton: false, }; ModalHeader.propTypes = { goBack: PropTypes.func, headers: PropTypes.array, withBackButton: PropTypes.bool, }; export default ModalHeader;