---
interface Props { section?: string; sectionHref?: string }
import { readOnlyMode } from "../lib/runtime";
const { section, sectionHref } = Astro.props;
const pathname = Astro.url.pathname.replace(/\/+$/, "") + "/";
let inferredLabel: string | undefined;
let inferredHref = "/app/";
if (pathname.startsWith("/app/inventory/")) {
if (pathname === "/app/inventory/") {
inferredLabel = "Inventory";
inferredHref = "/app/";
} else {
inferredLabel = "Inventory";
inferredHref = "/app/inventory/";
}
} else if (pathname.startsWith("/app/ingredients/")) {
inferredLabel = "Ingredients";
inferredHref = "/app/?type=ingredient";
} else if (pathname.startsWith("/app/recipe-books/")) {
inferredLabel = "Recipe Books";
inferredHref = "/app/?type=book";
} else if (pathname.startsWith("/app/recipes/")) {
inferredLabel = "Recipes";
inferredHref = "/app/?type=recipe";
} else if (pathname.startsWith("/app/archive")) {
inferredLabel = "Archive";
inferredHref = "/app/";
} else if (pathname.startsWith("/tools/purchasing-review")) {
inferredLabel = "Purchasing Review";
inferredHref = "/app/";
}
const resolvedSection = section ?? inferredLabel;
const resolvedHref = sectionHref ?? inferredHref;
---