"use client"; import React, { useState } from "react"; import { Play, Star, ShieldCheck, X } from "lucide-react"; import { motion, AnimatePresence } from "motion/react"; import Link from "next/link"; import SafeImage from "./SafeImage"; import { useSettingsStore } from "../lib/store/settingsStore"; import { videoService, Video } from "../lib/services/videoService"; import VideoModalPlayer from './VideoModalPlayer'; export interface TestimonialItem { id?: string; authorName?: string; roleTitle?: string; avatarUrl?: string; content?: string; clinicName?: string; vetName?: string; imageUrl?: string; quote?: string; title?: string; thumbnail?: string; videoUrl?: string; description?: string; isActive?: boolean; } const FALLBACK_VIDEOS = [ { id: "v1", title: "نحوه آماده‌سازی کانی‌هیدروکس GAG", doctor: "دکتر کلاوس هنینگ", duration: "۰۱:۴۵", thumbnail: "https://images.unsplash.com/photo-1576091160550-217359f42f8c?auto=format&fit=crop&q=80&w=400", videoUrl: "https://www.w3schools.com/html/mov_bbb.mp4", description: "آموزش گام به گام آماده‌سازی پودر Canhydrox GAG برای جذب حداکثری در دستگاه گوارش." }, { id: "v2", title: "اهمیت صدف لب‌سبز", doctor: "دکتر النا اشمیت", duration: "۰۲:۲۰", thumbnail: "https://images.unsplash.com/photo-1599443015574-be5fe8a05783?auto=format&fit=crop&q=80&w=400", videoUrl: "https://www.w3schools.com/html/movie.mp4", description: "چرا صدف لب‌سبز نیوزیلندی نایاب‌ترین و موثرترین ماده برای بازسازی مفصل است؟" }, { id: "v3", title: "تغذیه هوشمند توله‌سگ‌ها", doctor: "دکتر هلگا فیشر", duration: "۰۳:۱۰", thumbnail: "/assets/images/regenerated_image_1779109861747.png", videoUrl: "https://www.w3schools.com/html/mov_bbb.mp4", description: "دوز مصرفی مکمل‌های کلسیم در نژادهای بزرگ برای جلوگیری از بدشکلی‌های استخوانی." } ]; interface DisplayVideoItem { id: string; title?: string; doctor?: string; duration?: string; thumbnail?: string; videoUrl?: string; description?: string; quote?: string; imageUrl?: string; vetName?: string; } export default function VetGallery({ testimonials = [] }: { testimonials?: TestimonialItem[] }) { const getText = useSettingsStore(state => state.getText); const [apiVideos, setApiVideos] = useState([]); const [isLoading, setIsLoading] = useState(true); const [selectedVideo, setSelectedVideo] = useState