// is active parent check
export const isActiveParent = (data: any = [], path: any) => {
  if (data?.length !== 0) {
    return data?.some(({ items }: any) =>
      items?.some(
        (menu: any) =>
          menu.routePath.replace(/\/\d+/, "") === path.replace(/\/\d+/, "")
      )
    );
  }
};

// is active parent childe check
export const isActiveParentChaild = (data: any = [], path: any) => {
  if (data?.length !== 0) {
    return data?.some(
      (menu: any) =>
        menu.routePath.replace(/\/\d+/, "") === path.replace(/\/\d+/, "")
    );
  }
};

// is active link check
export const isActiveLink = (menuPath: any, routePath: any) => {
  if (menuPath && routePath) {
    return menuPath.replace(/\/\d+/, "") === routePath.replace(/\/\d+/, "");
  }
};
