import { Card, CardDescription, CardHeader, CardTitle, } from "@/components/ui/card" async function getStatus(): Promise<'open' | 'closed'> { try { const response = await fetch(`${process.env.NEXT_PUBLIC_BASE_URL || 'http://localhost:3000'}/api/status`, { cache: 'no-store' }); if (!response.ok) { return 'closed'; } const data = await response.json(); return data?.status === 'open' ? 'open' : 'closed'; } catch { return 'closed'; } } export async function Status() { const status = await getStatus(); const statusConfig = { open: { title: 'Open', description: "It's time to start hacking.", image: 'https://raw.githubusercontent.com/jetpham/noisebell/refs/heads/webhooks/media/open.png', color: 'text-green-600', bgColor: 'bg-green-50', borderColor: 'border-green-200' }, closed: { title: 'Closed', description: "We'll see you again soon.", image: 'https://raw.githubusercontent.com/jetpham/noisebell/refs/heads/webhooks/media/closed.png', color: 'text-red-600', bgColor: 'bg-red-50', borderColor: 'border-red-200' } } const config = statusConfig[status] return (
{config.title} {config.description}
{/* eslint-disable-next-line @next/next/no-img-element */} {`A
) }