/* eslint-disable @next/next/no-img-element */ import React, { useState } from 'react'; import { motion } from 'framer-motion'; import { Film, Tv, Star, Calendar, Clock, Users } from 'lucide-react'; import { useMediaQuery } from '@/hooks/use-media-query'; import { Dialog, DialogContent } from "@/components/ui/dialog"; import { Drawer, DrawerContent } from "@/components/ui/drawer"; import Image from 'next/image'; interface MediaDetails { id: number; media_type: 'movie' | 'tv'; title?: string; name?: string; overview: string; poster_path: string | null; backdrop_path: string | null; vote_average: number; vote_count: number; release_date?: string; first_air_date?: string; runtime?: number; episode_run_time?: number[]; genres: Array<{ id: number; name: string }>; credits: { cast: Array<{ id: number; name: string; character: string; profile_path: string | null; }>; }; origin_country?: string[]; original_language: string; production_companies?: Array<{ id: number; name: string; logo_path: string | null; }>; } interface TMDBResultProps { result: { result: MediaDetails | null; }; } const TMDBResult = ({ result }: TMDBResultProps) => { const [showDetails, setShowDetails] = useState(false); const isMobile = useMediaQuery("(max-width: 768px)"); if (!result.result) return null; const media = result.result; const formatDate = (dateStr: string) => { return new Date(dateStr).toLocaleDateString('en-US', { year: 'numeric', month: 'long', day: 'numeric' }); }; const formatRuntime = (minutes: number) => { const hours = Math.floor(minutes / 60); const mins = minutes % 60; return `${hours}h ${mins}m`; }; const DetailContent = () => (
{media.overview}
{media.credits?.cast && media.credits.cast.length > 0 && ({person.name}
{person.character}
{media.overview}
{media.credits?.cast && (Cast: {media.credits.cast.slice(0, 3).map(person => person.name).join(', ')}
)}