/** * @component DealOfDay * @purpose Section matching Screenshot 5 with 2 Medium Sound/Tech Banners, Hot Deals sidebar countdown timer, and Monthly Featured Item grid. * @dependencies catalogService, cartStore, lucide-react */ 'use client'; import { useState, useEffect } from 'react'; import Link from 'next/link'; import Image from 'next/image'; import { ChevronLeft, ChevronRight, Star } from 'lucide-react'; import { useCartStore } from '@/store/cartStore'; import { formatCurrency } from '@/lib/utils'; export function DealOfDay() { const addToCart = useCartStore((state) => state.addToCart); const [timeLeft, setTimeLeft] = useState({ days: 229, hours: 15, minutes: 2, seconds: 49 }); useEffect(() => { const timer = setInterval(() => { setTimeLeft((prev) => { if (prev.seconds > 0) return { ...prev, seconds: prev.seconds - 1 }; if (prev.minutes > 0) return { ...prev, minutes: 59, seconds: 59 }; if (prev.hours > 0) return { ...prev, hours: prev.hours - 1, minutes: 59, seconds: 59 }; return { days: Math.max(0, prev.days - 1), hours: 23, minutes: 59, seconds: 59 }; }); }, 1000); return () => clearInterval(timer); }, []); const featuredItems = [ { id: 'm1', name: 'Jajot J2 - Feature Phone, Single Sim Keypad Phone', price: 1500, oldPrice: 2000, image: '', }, { id: 'm2', name: 'Phonokart USB Type C OTG Cable', price: 450, oldPrice: 500, image: '', }, { id: 'm3', name: 'Logitech M350 WHITE Optical Mouse', price: 299, oldPrice: 350, image: '', }, ]; return (
{/* 2 Medium Banners (Matching Screenshot 5) */}
{/* Banner 1: Precision Sound */}

Precision Sound with Amazing Quality

USB 3 Rechargeable

Shop Now
Precision Sound Smartphone
{/* Banner 2: Nonstop Sound */}

Nonstop Sound With Amazing Quality

Portable Power In Style

Shop Now
Nonstop Sound Earbuds
{/* Hot Deals & Monthly Featured Item Section */}
{/* Hot Deals Countdown Box (1/4 col) */}

Hot Deals

-25% Hot Deal Phone
{/* Countdown Timer Row */}
{timeLeft.days} DAYS
{String(timeLeft.hours).padStart(2, '0')} HRS
{String(timeLeft.minutes).padStart(2, '0')} MIN
{String(timeLeft.seconds).padStart(2, '0')} SEC
{/* Monthly Featured Item (3/4 col) */}

Monthly Featured Item

{featuredItems.map((item) => (
{item.name}

{item.name}

{'★'.repeat(5)}
${item.price} ${item.oldPrice}
))}
); }