// src/components/PopUpDetail.jsx import { useEffect, useRef } from 'react'; import { gsap } from 'gsap'; export default function PopUpDetail({ point, onClose }) { const modalRef = useRef(); useEffect(() => { if (point) { gsap.fromTo(modalRef.current, { opacity: 0, scale: 0.8 }, { opacity: 1, scale: 1, duration: 0.5, ease: "back.out(1.7)" } ); } }, [point]); if (!point) return null; return ( // DaisyUI modal component
e.stopPropagation()} // หยุด event propagation ไม่ให้ปิดเมื่อคลิกใน modal >

{point.name} Details

Type: {point.type === 'news' ? 'News Region' : 'Statistics Region'}

Recent Updates:

{point.news && point.news.length > 0 ? (
    {point.news.map((item, index) => (
  • {item}
  • ))}
) : (

No specific updates available.

)}
); }