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

export default (props) => {
  const [app] = useSystemModel(s => s.app);

  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>
  );
}
