Files
3d497fcd-36b4-4a3f-954d-313…/src/app/shop/page.tsx
2026-02-22 13:48:17 +00:00

95 lines
3.7 KiB
TypeScript

"use client";
import { Suspense } from "react";
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
import ProductCatalog from "@/components/ecommerce/productCatalog/ProductCatalog";
import { useProductCatalog } from "@/hooks/useProductCatalog";
import NavbarLayoutFloatingOverlay from '@/components/navbar/NavbarLayoutFloatingOverlay/NavbarLayoutFloatingOverlay';
import FooterMedia from '@/components/sections/footer/FooterMedia';
import Link from 'next/link';
function ShopPageContent() {
const {
products,
isLoading,
search,
setSearch,
filters,
} = useProductCatalog({ basePath: "/shop" });
if (isLoading) {
return (
<>
<div id="nav" data-section="nav">
<NavbarLayoutFloatingOverlay
navItems={[{ name: "Home", id: "/" }]}
brandName="Dobry Khlib"
button={{ text: "Cart", onClick: () => console.log("cart") }}
/>
</div>
<main className="min-h-screen flex items-center justify-center pt-20">
<p className="text-foreground">Loading products...</p>
</main>
</>
);
}
return (
<>
<div id="nav" data-section="nav">
<NavbarLayoutFloatingOverlay
navItems={[{ name: "Home", id: "/" }]}
brandName="Dobry Khlib"
button={{ text: "Cart", onClick: () => console.log("cart") }}
/>
</div>
<div id="product-catalog" data-section="product-catalog">
<ProductCatalog
layout="page"
products={products}
searchValue={search}
onSearchChange={setSearch}
searchPlaceholder="Search products..."
filters={filters}
emptyMessage="No products found"
/>
</div>
</>
);
}
export default function ShopPage() {
return (
<Suspense>
<ThemeProvider
defaultButtonVariant="text-stagger"
defaultTextAnimation="entrance-slide"
borderRadius="soft"
contentWidth="mediumSmall"
sizing="largeSmall"
background="noise"
cardStyle="solid"
primaryButtonStyle="double-inset"
secondaryButtonStyle="glass"
headingFontWeight="normal"
>
<ShopPageContent />
<div id="footer" data-section="footer">
<FooterMedia
imageSrc="https://img.b2bpic.net/free-photo/white-cheese-bread-with-eggs_140725-3991.jpg?_wi=4"
imageAlt="Assortment of freshly baked Ukrainian goods"
columns={[
{title: "Bakery", items: [{label: "Our Story", href: "/#about"}, {label: "Products", href: "/#products"}, {label: "Order Online", href: "/#products"}]},
{title: "Support", items: [{label: "FAQ", href: "/#faq"}, {label: "Contact Us", href: "/#contact"}]},
{title: "Legal", items: [{label: "Privacy Policy", href: "/privacy"}, {label: "Terms of Service", href: "/terms"}]}
]}
logoText="Dobry Khlib"
copyrightText="© 2024 Dobry Khlib. All rights reserved."
onPrivacyClick={() => console.log('Privacy Policy clicked')}
/>
</div>
</ThemeProvider>
</Suspense>
);
}