feat: TASK-115 - enhance dosage and treatment cost calculator in ProductPage

This commit is contained in:
parsa aghaei committed 2026-07-26 16:04:39 +03:30
1 parent 21ef2149ba
commit 5284717cfb
3 files changed
+38 -10

No files matched your search

@@ -415,23 +415,37 @@ export default function ProductPage({ productSlug }: { productSlug: string }) {
</div>
{/* Calculation Results Output */}
<div className="bg-canina-blue rounded-[2rem] p-8 text-white border-b-8 border-white/20 shadow-2xl flex flex-col justify-between h-full min-h-[220px]">
<div className="flex items-center gap-2 mb-4 opacity-90 border-b border-white/10 pb-3">
<Sparkles className="w-4 h-4 text-white" />
<span className="text-[10px] font-bold uppercase tracking-widest font-vazir text-white">تخمین هوش مصنوعی (AI Advice)</span>
<div className="bg-canina-blue rounded-[2rem] p-8 text-white border-b-8 border-white/20 shadow-2xl flex flex-col justify-between h-full min-h-[240px]">
<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>
</div>
<span className="text-[10px] bg-white/20 px-2.5 py-0.5 rounded-full font-black">
پیشنهاد: {toPersian(itemQuantity)} بسته
</span>
</div>
<div className="flex items-center justify-between">
<div className="grid grid-cols-2 gap-4">
<div>
<div className="text-3xl font-black font-vazir text-white">{toPersian(calculation.duration)} روز</div>
<div className="text-[10px] font-bold text-white/80 font-vazir whitespace-nowrap mt-1">تخمین اتمام مصرف بسته</div>
<div className="text-[10px] font-bold text-white/80 font-vazir whitespace-nowrap mt-1">مدت تامین یک بسته</div>
</div>
<div className="text-left">
<div className="text-2xl font-black font-vazir text-white">{toPersian(calculation.dailyDose)}</div>
<div className="text-[10px] font-bold text-white/80 font-vazir whitespace-nowrap mt-1">دوز روزانه ({calculation.unit === 'g' ? 'گرم' : calculation.unit})</div>
</div>
</div>
<p className="text-[11px] text-white/60 font-bold font-vazir mt-6 leading-relaxed">
* دوزها تخمینی هستند؛ توصیه می‌شود برای مصرف دقیق کاتالوگ محصول را مطالعه کنید.
<div className="mt-4 pt-4 border-t border-white/10 flex items-center justify-between">
<span className="text-[11px] font-bold text-white/80">تخمین هزینه دوره ۳۰ روزه:</span>
<span className="text-sm font-black text-amber-300">
{toPersian((Math.ceil(30 / (calculation.duration || 30)) * (product.priceValue || 0)).toLocaleString())} تومان
</span>
</div>
<p className="text-[10px] text-white/60 font-bold font-vazir mt-3 leading-relaxed">
* دوز دقیق بر اساس وزن پت محاسبه شده است؛ برای ماندگاری کامل دوره، خرید تعداد بسته‌های پیشنهادی توصیه می‌شود.
</p>
</div>
</div>