// src/components/NewsPanel.jsx import React from 'react'; // เปลี่ยน videoStreamUrl เป็น youtubeVideoId export default function NewsPanel({ title, content, youtubeVideoId, isActive }) { const panelClasses = ` card w-80 shadow-2xl z-10 p-6 transition-all duration-500 ease-in-out transform ${isActive ? 'opacity-100 translate-x-0' : 'opacity-0 -translate-x-full pointer-events-none'} ${isActive ? 'glass bg-base-200 text-base-content' : ''} `; return (

{title}

{content}

{/* ส่วนสำหรับ YouTube Video Embed */} {youtubeVideoId && ( // ตรวจสอบว่ามี youtubeVideoId ส่งมาหรือไม่
{/* aspect-video ให้สัดส่วน 16:9 */}
)} {/* หากไม่มี youtubeVideoId และต้องการแสดง placeholder เดิม ให้เพิ่มเงื่อนไขนี้ */} {!youtubeVideoId && ( // ถ้าไม่มี YouTube ID ก็แสดง placeholder เก่า
[NO VIDEO STREAM AVAILABLE]
)}
); }