"use client" import { useIsMobile } from "@/hooks/use-mobile" import { cn } from "@/lib/utils" import { AnimatePresence, motion } from "framer-motion" import { useTheme } from "next-themes" import Image from "next/image" import type React from "react" interface ExpandableGalleryProps { id: string imgUrl: string title: string index: number active: string handleActive: (id: string) => void description?: string } const ExpandableGallery: React.FC = ({ id, imgUrl, title, index, active, handleActive, description = "", }) => { const isMobile = useIsMobile() const { resolvedTheme } = useTheme() const isDarkTheme = resolvedTheme === "dark" const isActive = active === id const itemVariants = { initial: { opacity: 0, y: 20, }, animate: { opacity: 1, y: 0, transition: { duration: 0.7, ease: [0.16, 1, 0.3, 1], delay: isMobile ? index * 0.08 : index * 0.12, }, }, } return ( handleActive(id)} layout > {title} {!isActive ? ( {title} ) : (

{title}

{description && (

{description}

)}
)}
) } export default ExpandableGallery