- {product.mainImageUrl && (
+ {product.imageUrl && (
{/* eslint-disable-next-line @next/next/no-img-element */}

diff --git a/app/(builder)/builder/[categoryId]/page.tsx b/app/(builder)/builder/[categoryId]/page.tsx
index 2d6721a..9ddbe7e 100644
--- a/app/(builder)/builder/[categoryId]/page.tsx
+++ b/app/(builder)/builder/[categoryId]/page.tsx
@@ -6,6 +6,7 @@ import { useParams, useRouter } from "next/navigation";
import { CATEGORIES } from "@/data/gunbuilderParts";
import type { CategoryId, Part } from "@/types/gunbuilder";
+
type ViewMode = "card" | "list";
type GunbuilderProductFromApi = {
@@ -134,11 +135,6 @@ export default function CategoryPage() {
}
}, [build]);
- useEffect(() => {
- // whenever the category or filters change, jump back to page 1
- setCurrentPage(1);
- }, [categoryId, brandFilter, sortBy, searchQuery]);
-
// handler to toggle Add / Remove for this category
const handleTogglePart = (categoryId: CategoryId, partId: string) => {
const isSelected = build[categoryId] === partId;
@@ -293,6 +289,7 @@ export default function CategoryPage() {
return { start, end };
}, [filteredParts.length, currentPage, paginatedParts.length, PAGE_SIZE]);
+
if (!category) {
return (
diff --git a/app/page.tsx b/app/page.tsx
index 782f6fb..d8adb76 100644
--- a/app/page.tsx
+++ b/app/page.tsx
@@ -6,9 +6,9 @@ import Image from "next/image";
export default function HomePage() {
const [email, setEmail] = useState("");
const [useCase, setUseCase] = useState("");
- const [status, setStatus] = useState<"idle" | "loading" | "success" | "error">(
- "idle"
- );
+ const [status, setStatus] = useState<
+ "idle" | "loading" | "success" | "error"
+ >("idle");
const [message, setMessage] = useState(null);
async function handleSubmit(e: FormEvent) {
@@ -47,7 +47,7 @@ export default function HomePage() {
return (
{/* Abstract Brand Background */}
-
+