import { i as require_jsx_runtime } from "../_libs/react+tanstack__react-query.mjs";
import { h as Link } from "../_libs/@tanstack/react-router+[...].mjs";
import { i as SiteLayout, n as PageTitle, r as Prose, t as PageBody } from "./Layout-mJm59hV1.mjs";
import { r as products, t as categories } from "./catalog-CQ3AfDKO.mjs";
import { n as ProductCard } from "./Collection-MT6nxUuh.mjs";
import { n as titleCase, t as Route } from "./product-category._category._subcategory-uSMesTzN.mjs";
//#region node_modules/.nitro/vite/services/ssr/assets/product-category._category._subcategory-Df0kqw7v.js
var import_jsx_runtime = require_jsx_runtime();
function Page() {
	const { category, subcategory } = Route.useParams();
	const meta = categories.find((c) => c.path === `/product-category/${category}/${subcategory}`);
	const items = products.filter((p) => p.category === category);
	const siblings = categories.filter((c) => c.path.startsWith(`/product-category/${category}/`));
	return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SiteLayout, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(PageBody, { children: [
		/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("nav", {
			className: "mb-4 text-sm text-muted-foreground",
			children: [
				/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Link, {
					to: "/",
					className: "hover:text-maroon",
					children: "Home"
				}),
				" ",
				"/ ",
				/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Link, {
					to: "/categories-of-our-catalog",
					children: "Categories"
				}),
				" / ",
				titleCase(category),
				" /",
				" ",
				meta?.name ?? titleCase(subcategory)
			]
		}),
		/* @__PURE__ */ (0, import_jsx_runtime.jsx)(PageTitle, { children: meta?.name ?? titleCase(subcategory) }),
		/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Prose, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { children: [
			meta ? `There are ${meta.count} items catalogued in this category.` : "Items in this category are being catalogued and added to the site regularly.",
			" ",
			"Every piece is inspected in our Boulder gallery and guaranteed as described."
		] }) }),
		/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
			className: "mt-10 grid gap-10 lg:grid-cols-[260px_1fr]",
			children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("aside", { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("h2", {
				className: "font-display text-xl text-maroon",
				children: ["More in ", titleCase(category)]
			}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ul", {
				className: "mt-3 space-y-1.5 text-[15px]",
				children: siblings.map((s) => {
					const sub = s.path.split("/").pop() ?? "";
					return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Link, {
						to: "/product-category/$category/$subcategory",
						params: {
							category,
							subcategory: sub
						},
						className: "hover:text-maroon",
						activeProps: { className: "text-maroon font-semibold" },
						children: [
							s.name,
							" (",
							s.count,
							")"
						]
					}) }, s.path);
				})
			})] }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: items.length ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
				className: "grid gap-6 sm:grid-cols-2 xl:grid-cols-3",
				children: items.map((p) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ProductCard, { product: p }, p.slug))
			}) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", {
				className: "text-foreground/80",
				children: [
					"These items are not online yet. Please use our",
					" ",
					/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Link, {
						to: "/request-an-item",
						className: "text-maroon underline",
						children: "request-an-item form"
					}),
					" ",
					"and we will search our inventory for you."
				]
			}) })]
		})
	] }) });
}
//#endregion
export { Page as component };
