
import { Helmet } from "react-helmet";
import { useModel } from '@/store';
import useRoute from '@/utils/hooks/useRoute';

export default (props) => {
  const { app } = useModel('system');
  const route = useRoute();
  const { title } = route && route.meta || {}
  
  const titleTemplate = `%s - ${app.fullName}`;
  const defaultTitle = app.fullName;

  return (
    <Helmet titleTemplate={titleTemplate} defaultTitle={defaultTitle}>
      <title>{title}</title>
    </Helmet>
  );
}
