feat: Wabenhain Honig-Shop Anwendung
Vollstaendige Next.js/Prisma-E-Commerce-Anwendung fuer eine Imkerei: Shop, Warenkorb, Stripe-Checkout, Kundenkonto mit 2FA, Admin-Bereich (Produkte, Ernten, Chargen, Bestellungen, Gutscheine, admin-editierbare Website-Inhalte), i18n (DE/EN), Rate-Limiting/CSP/Audit-Log-Haertung, PostgreSQL- und MySQL-Unterstuetzung ueber austauschbare Prisma- Treiber-Adapter, Unit-/Komponenten-/E2E-Tests.
This commit is contained in:
1 parent
5c76fcc266
commit
c7927f2883
240 files changed
+26096
-137
No files matched your search
@@ -0,0 +1,17 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect } from "react";
|
||||
import { useRecentlyViewedStore } from "@/store/recently-viewed-store";
|
||||
|
||||
/** Rendert nichts — zeichnet den Produktbesuch nur im lokalen "zuletzt angesehen"-Verlauf auf. */
|
||||
export function RecordProductView({ productId }: { productId: string }) {
|
||||
const addViewed = useRecentlyViewedStore((s) => s.addViewed);
|
||||
|
||||
useEffect(() => {
|
||||
addViewed(productId);
|
||||
// Nur beim Mount/Produktwechsel aufzeichnen, nicht bei jedem Store-Update.
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [productId]);
|
||||
|
||||
return null;
|
||||
}
|
||||
Reference in new issue
Block a user