import { LastRefresh } from './LastRefresh' import Image from 'next/image' export function Navbar({ lastUpdateTime }) { const handleExport = async (timeRange) => { try { const response = await fetch(`/api/export-report?timeRange=${timeRange}`) const blob = await response.blob() const url = window.URL.createObjectURL(blob) const a = document.createElement('a') a.href = url a.download = `solar-report-${timeRange}-${new Date().toISOString().split('T')[0]}.pdf` document.body.appendChild(a) a.click() window.URL.revokeObjectURL(url) document.body.removeChild(a) } catch (error) { console.error('Error exporting report:', error) } } return ( ) }