feat: add BackButton, protect UserDashboard auth, fix product loading metadata title and add WebOTP auto-submit

This commit is contained in:
parsa aghaei committed 2026-08-01 18:32:33 +03:30
1 parent 2ce24b0473
commit 9870516256
9 files changed
+185 -51

No files matched your search

@@ -2,12 +2,14 @@
import React, { useState, useEffect, useRef } from "react";
import SafeImage from "../../components/SafeImage";
import BackButton from "../../components/BackButton";
import { Download, Printer, ShieldCheck, Sparkles, CheckCircle2, ChevronLeft, Search, Filter } from "lucide-react";
import Link from "next/link";
import { productService } from "../../lib/services/productService";
import { Product } from "../../lib/data/products";
import { toPersian } from "../../lib/utils";
export default function CatalogClient() {
const [products, setProducts] = useState<Product[]>([]);
const [loading, setLoading] = useState(true);
@@ -89,6 +91,7 @@ export default function CatalogClient() {
</div>
<div className="flex flex-wrap items-center gap-4">
<BackButton className="bg-white/10 text-white border-white/20 hover:bg-white/20 hover:text-white" />
<button
onClick={handlePrint}
className="bg-amber-400 hover:bg-amber-500 text-slate-900 font-black px-6 py-4 rounded-2xl shadow-xl hover:scale-105 transition-all flex items-center gap-3 text-sm cursor-pointer"
@@ -11,7 +11,7 @@ export async function generateMetadata(
if (!product) {
return {
title: 'محصول یافت نشد',
title: 'خرید مکمل درمانی پت | کانینا ایران',
};
}