SPB Git forge

spb/websensor

Public
33commits 1branches 0releases
3.4 MBsize
maindefault branch
10 days agolast push
TypeScript 55.4% Python 43.2% SQL 1.2%
2.1 KB · 34 lines tsx
Raw Blame History
1"use client";23import { AlertTriangle, RotateCcw } from "lucide-react";4import Link from "next/link";5import { useEffect } from "react";6import { Kbd, Panel } from "@/components/ui";78export default function ErrorPage({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) {9  useEffect(() => {10    console.error(error);11  }, [error]);12  return (13    <div className="mx-auto max-w-lg py-12 sm:py-20">14      <Panel dense>15        <div className="flex flex-col items-center gap-2 px-4 py-10 text-center">16          <span className="font-mono text-[11px] font-semibold tracking-wider text-danger">RENDER ERROR</span>17          <AlertTriangle className="mt-1 size-6 text-danger" aria-hidden />18          <h1 className="mt-1 text-lg font-semibold leading-tight">Something went wrong while rendering</h1>19          <p className="max-w-sm text-[13px] text-fg-muted">The sensors and the API are unaffected; only this view failed. Retrying usually works — the gateway may have been warming up.</p>20          {(error.digest || error.message) && <code className="mt-1 max-w-full truncate rounded-sm border border-line bg-panel-2 px-2 py-0.5 font-mono text-[11px] text-fg-subtle" title={error.message}>{error.digest ?? error.message}</code>}21          <div className="mt-4 flex flex-wrap justify-center gap-2 text-[12.5px]">22            <button type="button" onClick={reset} className="inline-flex h-8 items-center gap-1.5 rounded-md border border-signal/40 bg-signal-soft px-3 text-signal hover:border-signal"><RotateCcw className="size-3.5" /> Try again</button>23            <Link href="/live" className="inline-flex h-8 items-center rounded-md border border-line bg-panel px-3 hover:border-line-strong">Live feed</Link>24            <Link href="/explore" className="inline-flex h-8 items-center rounded-md border border-line bg-panel px-3 hover:border-line-strong">Explore</Link>25          </div>26          <p className="mt-3 flex items-center gap-1.5 text-[11px] text-fg-subtle">27            <Kbd>⌘</Kbd><Kbd>K</Kbd> opens search from any page.28          </p>29        </div>30      </Panel>31    </div>32  );33}34