import React, { memo } from 'react';
import { Helmet } from 'react-helmet';
import PropTypes from 'prop-types';

import favicon from '../../assets/images/logo-strapi.png';

const PageTitle = ({ title }) => {

  let customTitle  = title.split('-')
  if(customTitle.length>1) {
    customTitle[0] = 'Paymentus'
    customTitle = customTitle.join('-')
  }
  else {
    customTitle = title
  }
return <Helmet title={customTitle} link={[{ rel: 'icon', type: 'image/png', href: favicon }]} />
};

PageTitle.propTypes = {
  title: PropTypes.string.isRequired,
};

export default memo(PageTitle);
