import React, { useState, useEffect } from 'react'; import { Slider } from '@/components/ui/slider'; import { Input } from '@/components/ui/input'; import { Button } from '@/components/ui/button'; import { RefreshCw } from 'lucide-react'; const TimelineCamera = () => { const [timeOffset, setTimeOffset] = useState(0); const [jsonUrl, setJsonUrl] = useState(''); const [loading, setLoading] = useState(false); const [cameraData, setCameraData] = useState({ az_deg: 182.68, tilt_deg: -1.42, zoom: 1412, fov_deg: 10.04, image_timestamp: "2025-01-10T01:27:48Z" }); const handleLoadJson = async () => { if (!jsonUrl) return; setLoading(true); try { // In a real implementation, this would fetch and parse the JSON // For now, we'll just simulate the loading state await new Promise(resolve => setTimeout(resolve, 1000)); } catch (error) { console.error('Error loading JSON:', error); } finally { setLoading(false); } }; // Simulate camera changes based on time offset useEffect(() => { const updateCameraData = () => { setCameraData({ az_deg: 182.68 + Math.sin(timeOffset / 10) * 20, tilt_deg: -1.42 + Math.cos(timeOffset / 8) * 5, zoom: 1412 + Math.sin(timeOffset / 15) * 200, fov_deg: 10.04 + Math.cos(timeOffset / 12) * 2, image_timestamp: new Date(new Date("2025-01-10T01:27:48Z").getTime() + timeOffset * 60000).toISOString() }); }; updateCameraData(); }, [timeOffset]); return (