1 import { useMemo } from 'react';
3 import { getAppName } from '@proton/shared/lib/apps/helper';
5 import useConfig from './useConfig';
6 import useDocumentTitle from './useDocumentTitle';
8 const useAppTitle = (title?: string, maybeAppName?: string) => {
9 const { APP_NAME } = useConfig();
11 const memoedTitle = useMemo(() => {
12 const appName = maybeAppName || getAppName(APP_NAME);
13 return [title, appName].filter(Boolean).join(' - ');
16 useDocumentTitle(memoedTitle);
19 export default useAppTitle;