'use client'; // کارت نمایش هر دستگاه داخل ویترین: شامل جلوه اسپات‌لایت (هاور روی عکس دستگاه رنگ جایگزین را نشان می‌دهد)، // آیتم‌های شناور، گیف+توضیحات، و دکمه‌های افزودن به سبد / مشاهده سریع / علاقه‌مندی. import {useRef, useState} from 'react'; import {Button, Tooltip, message} from 'antd'; import {ShoppingCartOutlined, EyeOutlined, HeartOutlined, HeartFilled} from '@ant-design/icons'; import {useDispatch} from 'react-redux'; import {addToCart} from '@/store/cartSlice'; import {useLanguage} from '@/app/context/LanguageContext'; import FloatingItems from './FloatingItems'; import {floatingSnacks} from '@/data/content'; export default function VendingCard({machine, onQuickView}) { const dispatch = useDispatch(); const {t, dir} = useLanguage(); const [wishlisted, setWishlisted] = useState(false); const stageRef = useRef(null); const lensRef = useRef(null); const revealRef = useRef(null); const handleMouseMove = (e) => { const stage = stageRef.current; if (!stage) return; const rect = stage.getBoundingClientRect(); const x = e.clientX - rect.left; const y = e.clientY - rect.top; if (lensRef.current) { lensRef.current.style.transform = `translate(${x}px, ${y}px) translate(-50%, -50%)`; } if (revealRef.current) { revealRef.current.style.clipPath = `circle(95px at ${x}px ${y}px)`; } }; const handleMouseLeave = () => { if (revealRef.current) revealRef.current.style.clipPath = 'circle(0px at 50% 50%)'; }; const handleAddToCart = () => { dispatch( addToCart({ id: machine.id, name: machine.name, priceNumeric: machine.priceNumeric, priceLabel: machine.priceLabel, image: machine.image, }) ); message.success(t.cart.addToast(machine.name)); }; return (
{machine.name} {`${machine.name}
{t.machineActions.hoverHint}
{machine.shortLabel}

{machine.name}

{t.machineActions.gifAlt(machine.name)}

{machine.description}

    {machine.highlights.map((h) => (
  • {h}
  • ))}

{machine.priceLabel}

{/**/} {/* : }*/} {/* onClick={() => setWishlisted((v) => !v)}*/} {/* />*/} {/**/}
); }