fix(frontend): fix TypeScript error in Back button navigate call

Split ternary into two separate navigate() calls to satisfy TypeScript
overload resolution — navigate(delta: number) and navigate(to: To)
are distinct overloads that cannot share a ternary return type.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Shekhar Vaidya 2026-05-18 12:11:35 +05:30
parent 8b036e94ba
commit e7b0fea94b

View file

@ -213,7 +213,7 @@ export default function ProductDetailPage() {
<div className="max-w-xl mx-auto px-5 pt-12 pb-10">
{/* Back */}
<button
onClick={() => navigate(window.history.state?.idx ? -1 : '/')}
onClick={() => window.history.state?.idx ? navigate(-1) : navigate('/')}
className="flex items-center gap-1.5 text-sm text-zinc-500 hover:text-zinc-300 mb-8 transition-colors"
>
<ArrowLeft size={15} />