feat: complete admin url query sync, full sorting/filters, latin search, product media players, personalized pet name and stage noindex
Deploy Canina / deploy (push) Successful in 1m57s

This commit is contained in:
parsa aghaei committed 2026-08-18 11:02:57 +03:30
1 parent d5c05b7577
commit 27a1517464
23 files changed
+168815 -46100

No files matched your search

+116 -7
View File
@@ -27,7 +27,8 @@ import {
Thermometer,
AlertTriangle,
Share2,
Phone
Phone,
Download
} from "lucide-react";
const ICON_MAP: Record<string, React.ComponentType<{ className?: string }>> = {
@@ -454,8 +455,14 @@ export default function ProductPage({ productSlug }: { productSlug: string }) {
<Clock className="w-6 h-6" />
</div>
<div>
<h3 className="text-lg sm:text-2xl font-black text-medical-gray-900 italic font-vazir whitespace-nowrap">ماشین حساب هوشمند مصرف</h3>
<p className="text-[11px] sm:text-xs text-medical-gray-400 font-bold font-vazir mt-0.5 sm:mt-1">تخمین دقیق دوز روزانه و ماندگاری هر بسته بر اساس مشخصات پت شما</p>
<h3 className="text-lg sm:text-2xl font-black text-medical-gray-900 italic font-vazir whitespace-nowrap">
{activePet ? `ماشین حساب هوشمند مصرف برای ${activePet.name}` : 'ماشین حساب هوشمند مصرف'}
</h3>
<p className="text-[11px] sm:text-xs text-medical-gray-400 font-bold font-vazir mt-0.5 sm:mt-1">
{activePet
? `تخمین دقیق دوز روزانه و ماندگاری هر بسته بر اساس وزن و سن ${activePet.name}`
: 'تخمین دقیق دوز روزانه و ماندگاری هر بسته بر اساس مشخصات پت شما'}
</p>
</div>
</div>
@@ -463,7 +470,9 @@ export default function ProductPage({ productSlug }: { productSlug: string }) {
{/* Manual Slider Inputs */}
<div className="bg-medical-gray-50 rounded-[2rem] p-6 border border-medical-gray-100 space-y-6">
<div className="flex items-center justify-between">
<span className="text-xs font-black text-medical-gray-500 font-vazir">وزن پت (کیلوگرم)</span>
<span className="text-xs font-black text-medical-gray-500 font-vazir">
{activePet ? `وزن ${activePet.name} (کیلوگرم)` : 'وزن پت (کیلوگرم)'}
</span>
<span className="text-lg font-black text-canina-blue font-vazir">{toPersian(weight)} ک‌گ</span>
</div>
<input
@@ -475,7 +484,9 @@ export default function ProductPage({ productSlug }: { productSlug: string }) {
/>
<div className="space-y-2">
<span className="text-[10px] font-black text-medical-gray-400 font-vazir">سن حیوان</span>
<span className="text-[10px] font-black text-medical-gray-400 font-vazir">
{activePet ? `سن ${activePet.name}` : 'سن حیوان'}
</span>
<div className="flex gap-2">
<button onClick={() => setPetType("young")} className={`flex-1 py-3 rounded-xl text-xs font-black transition-all border ${petType === "young" ? 'bg-canina-blue border-canina-blue text-white shadow-lg' : 'bg-white border-medical-gray-200 text-medical-gray-400'}`}>جوان</button>
<button onClick={() => setPetType("adult")} className={`flex-1 py-3 rounded-xl text-xs font-black transition-all border ${petType === "adult" ? 'bg-canina-blue border-canina-blue text-white shadow-lg' : 'bg-white border-medical-gray-200 text-medical-gray-400'}`}>بالغ</button>
@@ -488,7 +499,9 @@ export default function ProductPage({ productSlug }: { productSlug: string }) {
<div className="flex items-center justify-between mb-4 opacity-90 border-b border-white/10 pb-3">
<div className="flex items-center gap-2">
<Sparkles className="w-4 h-4 text-amber-300" />
<span className="text-[10px] font-bold uppercase tracking-widest font-vazir text-white">محاسبه‌گر دوره درمانی (AI Calculator)</span>
<span className="text-[10px] font-bold uppercase tracking-widest font-vazir text-white">
{activePet ? `محاسبه‌گر دوره درمانی برای ${activePet.name}` : 'محاسبه‌گر دوره درمانی (AI Calculator)'}
</span>
</div>
<span className="text-[10px] bg-white/20 px-2.5 py-0.5 rounded-full font-black">
پیشنهاد: {toPersian(itemQuantity)} بسته
@@ -514,7 +527,9 @@ export default function ProductPage({ productSlug }: { productSlug: string }) {
</div>
<p className="text-[10px] text-white/60 font-bold font-vazir mt-3 leading-relaxed">
* دوز دقیق بر اساس وزن پت محاسبه شده است؛ برای ماندگاری کامل دوره، خرید تعداد بسته‌های پیشنهادی توصیه می‌شود.
{activePet
? `* دوز دقیق بر اساس وزن ${activePet.name} (${toPersian(weight)} ک‌گ) محاسبه شده است؛ برای ماندگاری کامل دوره، خرید تعداد بسته‌های پیشنهادی توصیه می‌شود.`
: '* دوز دقیق بر اساس وزن پت محاسبه شده است؛ برای ماندگاری کامل دوره، خرید تعداد بسته‌های پیشنهادی توصیه می‌شود.'}
</p>
</div>
</div>
@@ -659,6 +674,100 @@ export default function ProductPage({ productSlug }: { productSlug: string }) {
</div>
</section>
{/* Multimedia & Scientific Documentation (Video, Podcast & PDF Catalog) */}
{(product.videoUrl || product.podcastUrl || product.pdfUrl) && (
<section className="bg-white border border-medical-gray-200 rounded-[2.5rem] p-8 md:p-10 shadow-md space-y-8 font-vazir" dir="rtl">
<div className="flex items-center gap-4 border-b border-medical-gray-100 pb-6">
<div className="w-12 h-12 bg-purple-600 text-white rounded-2xl flex items-center justify-center shadow-lg">
<Sparkles className="w-6 h-6" />
</div>
<div>
<h3 className="text-2xl md:text-3xl font-black text-medical-gray-900 italic">رسانه و مستندات تخصصی محصول</h3>
<p className="text-xs text-medical-gray-400 font-bold mt-1">ویدیو آموزشی، پادکست تحلیل علمی و دفترچه کاتالوگ کارخانه Canina</p>
</div>
</div>
<div className="grid grid-cols-1 gap-6">
{/* Video Player Box */}
{product.videoUrl && (
<div className="bg-gray-900 rounded-3xl overflow-hidden shadow-xl border border-gray-800 p-4 space-y-3">
<div className="flex items-center justify-between px-2 text-white">
<span className="text-sm font-bold flex items-center gap-2">
<span className="w-2.5 h-2.5 rounded-full bg-red-500 animate-pulse"></span>
ویدیو معرفی و راهنمای محصول
</span>
<span className="text-[11px] text-gray-400 font-mono">Video Guide</span>
</div>
<div className="relative w-full aspect-video rounded-2xl overflow-hidden bg-black flex items-center justify-center">
{product.videoUrl.includes('<iframe') ? (
<div
className="w-full h-full [&>iframe]:w-full [&>iframe]:h-full"
dangerouslySetInnerHTML={{ __html: product.videoUrl }}
/>
) : (
<video
src={product.videoUrl}
controls
playsInline
className="w-full h-full object-contain"
poster={product.image}
>
مرورگر شما از پخش ویدیو پشتیبانی نمی‌کند.
</video>
)}
</div>
</div>
)}
{/* Podcast / Audio Player Box */}
{product.podcastUrl && (
<div className="bg-gradient-to-r from-blue-50 to-indigo-50/60 border border-blue-200 rounded-3xl p-6 space-y-4 shadow-sm">
<div className="flex items-center justify-between">
<div className="flex items-center gap-3">
<div className="w-10 h-10 rounded-xl bg-canina-blue text-white flex items-center justify-center shadow-md">
🎧
</div>
<div>
<h4 className="text-sm font-black text-gray-900">پادکست و بررسی صوتی بالینی مکمل</h4>
<p className="text-[11px] text-gray-500 font-bold">توضیحات صوتی دامپزشک درباره اثربخشی و دوز مصرفی</p>
</div>
</div>
<span className="text-[10px] bg-canina-blue/10 text-canina-blue px-3 py-1 rounded-full font-bold">پادکست اختصاصی</span>
</div>
<audio controls className="w-full h-10 rounded-xl accent-canina-blue">
<source src={product.podcastUrl} />
مرورگر شما از پخش صوت پشتیبانی نمی‌کند.
</audio>
</div>
)}
{/* PDF Catalog Download Box */}
{product.pdfUrl && (
<div className="bg-medical-gray-50 border border-medical-gray-200 rounded-3xl p-6 flex flex-col sm:flex-row items-center justify-between gap-4 shadow-xs">
<div className="flex items-center gap-4 text-center sm:text-right">
<div className="w-12 h-12 rounded-2xl bg-red-100 text-red-600 flex items-center justify-center font-black text-xs shadow-sm shrink-0">
PDF
</div>
<div>
<h4 className="text-base font-black text-gray-900">بروشور و کاتالوگ علمی Canina آلمان</h4>
<p className="text-xs text-gray-500 font-medium mt-0.5">شامل مقالات رفرنس، جدول ترکیبات دقیق و سرتیفیکیت رسمی</p>
</div>
</div>
<a
href={product.pdfUrl}
target="_blank"
rel="noreferrer"
className="bg-canina-blue hover:bg-blue-700 text-white px-6 py-3 rounded-2xl font-black text-xs transition-all shadow-md shadow-canina-blue/20 flex items-center gap-2 shrink-0 cursor-pointer"
>
<Download className="w-4 h-4" />
<span>دانلود مستقیم فایل PDF</span>
</a>
</div>
)}
</div>
</section>
)}
{/* FAQ Section */}
{product.faqs && product.faqs.length > 0 && (
<section className="pt-10">