'use client'; import type {Machine} from '@/types/domain'; import type {MouseEvent} from 'react'; import {useRef} from 'react'; import Link from 'next/link'; import QuantityControl from './QuantityControl'; import {commerceCopy} from '@/data/commerce'; import {useLanguage} from '@/app/context/LanguageContext'; import FloatingItems from './FloatingItems'; import {floatingSnacks} from '@/data/content'; export default function VendingCard({machine}: {machine: Machine}) { const {t, dir, locale} = useLanguage(); const stageRef = useRef(null); const lensRef = useRef(null); const revealRef = useRef(null); const handleMouseMove = (e: MouseEvent) => { 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%)'; }; 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}

{commerceCopy[locale].details}
); }