mirror of
https://github.com/ichsankurnia/hats-app.git
synced 2026-12-05 10:46:29 +00:00
20b77dc0b7
Add installable app metadata and icons, register a service worker for asset and page caching, and provide an offline page when navigation fails.
44 lines
1.8 KiB
TypeScript
44 lines
1.8 KiB
TypeScript
'use client';
|
|
|
|
import { WifiOff, RefreshCw } from 'lucide-react';
|
|
import Image from 'next/image';
|
|
import { Button } from '@/components/ui/button';
|
|
|
|
export default function OfflinePage() {
|
|
return (
|
|
<div className="min-h-screen flex flex-col items-center justify-center p-6 bg-background text-foreground text-center">
|
|
<div className="max-w-md w-full flex flex-col items-center space-y-6 rounded-2xl border border-border bg-card p-8 shadow-sm">
|
|
<div className="relative flex h-20 w-20 items-center justify-center rounded-2xl bg-muted/60 p-3">
|
|
<Image
|
|
src="/assets/logo192.png"
|
|
alt="H.A.T.s Logo"
|
|
width={64}
|
|
height={64}
|
|
className="rounded-xl object-contain"
|
|
/>
|
|
<div className="absolute -bottom-1 -right-1 rounded-full bg-destructive/10 p-1.5 text-destructive border border-destructive/20">
|
|
<WifiOff className="h-4 w-4" />
|
|
</div>
|
|
</div>
|
|
|
|
<div className="space-y-2">
|
|
<h1 className="text-xl font-bold tracking-tight sm:text-2xl">
|
|
You are currently offline
|
|
</h1>
|
|
<p className="text-sm text-muted-foreground leading-relaxed">
|
|
It looks like your internet connection was lost. Please check your network and try again.
|
|
</p>
|
|
</div>
|
|
|
|
<Button
|
|
onClick={() => window.location.reload()}
|
|
className="w-full gap-2 font-medium"
|
|
>
|
|
<RefreshCw className="h-4 w-4" />
|
|
Retry Connection
|
|
</Button>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|