'use client'; import React, { useEffect, useState } from 'react'; import { RefreshCw, Home, ChevronDown } from 'lucide-react'; import Link from 'next/link'; interface ErrorProps { error: Error & { digest?: string }; reset: () => void; } export default function Error({ error, reset }: ErrorProps) { const [isRetrying, setIsRetrying] = useState(false); const [showDetails, setShowDetails] = useState(false); useEffect(() => { console.error('Storefront error boundary caught:', error); // Auto-recover from chunk load errors caused by production redeployments const msg = (error?.message || '').toLowerCase(); const isChunkError = error?.name === 'ChunkLoadError' || msg.includes('loading chunk') || msg.includes('failed to fetch dynamically imported module'); if (isChunkError && typeof window !== 'undefined') { const retryKey = `chunk_reload_${window.location.pathname}`; const hasRetried = sessionStorage.getItem(retryKey); if (!hasRetried) { sessionStorage.setItem(retryKey, '1'); window.location.reload(); } } }, [error]); const handleRefresh = () => { setIsRetrying(true); if (typeof window !== 'undefined') { window.location.reload(); } else { reset(); } }; return (
{/* Top Navy Banner matching Image 2 */}
{/* White Circular Badge with crossed wrench & screwdriver */}
{/* Long 45-deg flat shadow */} {/* Screwdriver (top-left to bottom-right) */} {/* Wrench (bottom-left to top-right) */}
{/* Heading Text */}
WEBSITE
UNDER
MAINTENANCE
{/* Bottom Content Body */}

We’ll be back soon!

Sorry for the inconvenience but we're performing some maintenance at the moment. If you need to you can always{' '} contact us , otherwise we'll be back online shortly!

— The iFixKart Team

{/* Action Buttons */}
Return Home
{/* Technical Diagnostics (Collapsible for dev & debugging) */} {error?.message && (
{showDetails && (

{error.name || 'Error'}: {error.message}

{error.digest &&

Digest: {error.digest}

}
)}
)}
); }