'use client'; import { useState, useEffect } from 'react'; import { motion, AnimatePresence } from 'framer-motion'; interface PolycamEmbedProps { captureId: string; title: string; index?: number; } export function PolycamEmbed({ captureId, title, index = 0 }: PolycamEmbedProps) { const [isFullscreen, setIsFullscreen] = useState(false); const [isLoading, setIsLoading] = useState(true); const [hasError, setHasError] = useState(false); const [isDesktop, setIsDesktop] = useState(true); useEffect(() => { const checkDesktop = () => { setIsDesktop(window.innerWidth >= 1024); }; checkDesktop(); window.addEventListener('resize', checkDesktop); return () => window.removeEventListener('resize', checkDesktop); }, []); const itemVariants = { hidden: { opacity: 0, y: 20, }, visible: { opacity: 1, y: 0, }, }; return ( <> {/* Regular Embed */}
{/* Loading Skeleton */} {isLoading && !hasError && (
)} {/* Error State */} {hasError && (

Failed to load 3D scan

Please try again later

)}