error.tsx 793 B

123456789101112131415161718192021222324252627282930
  1. "use client";
  2. import { useEffect } from "react";
  3. import { Button } from "@/components/ui/button";
  4. import { ErrorBanner } from "@/components/ui/error-banner";
  5. export default function Error({
  6. error,
  7. reset,
  8. }: {
  9. error: Error & { digest?: string };
  10. reset: () => void;
  11. }) {
  12. useEffect(() => {
  13. console.error(error);
  14. }, [error]);
  15. return (
  16. <div className="flex min-h-[60vh] flex-col items-center justify-center px-4 text-center">
  17. <ErrorBanner title="Something went wrong on this page">
  18. The krypco network is fine — this is a website glitch. Tap try again, or
  19. refresh the whole page if it keeps failing.
  20. </ErrorBanner>
  21. <Button type="button" onClick={reset} className="mt-6 min-h-11 px-6">
  22. Try again
  23. </Button>
  24. </div>
  25. );
  26. }