import { menuItems } from '../constants/menuItems';

const getPageTitle = (path) => {
  const isUserProfileSummary = /^\/user-profile\/\d+$/.test(path);
  for (const item of menuItems) {
    if (item.Path === path && item.Menu_Name !== item.SubFeatureName) {
      return item.SubFeatureName;
    }
     if (item.Path === path) {
      return item.Menu_Name;
    }
     if (isUserProfileSummary) {
      return "User Profile Summary"
    }
  }
};

export default getPageTitle;
