export default function parsePageUrl(url?: string, admin?: boolean) {
    if (!url) return null;

    let finalAdminUrlArray = url?.match(/_next/)
        ? null
        : url
              ?.split("?")[0]
              .split("#")[0]
              .split("/")
              .filter((item) => item !== "");

    const finalAdminUrl = "/" + finalAdminUrlArray?.join("/") || "";

    return finalAdminUrl;
}
