import { useNavigate } from "@solidjs/router"; import { createEffect, createSignal, For } from "solid-js"; export interface ErrorBoundaryFallbackProps { error: Error; reset: () => void; } export default function ErrorBoundaryFallback( props: ErrorBoundaryFallbackProps ) { const navigate = useNavigate(); const [glitchText, setGlitchText] = createSignal("ERROR"); createEffect(() => { console.error(props.error); const glitchChars = "!@#$%^&*()_+-=[]{}|;':\",./<>?~`"; const originalText = "ERROR"; const glitchInterval = setInterval(() => { if (Math.random() > 0.8) { let glitched = ""; for (let i = 0; i < originalText.length; i++) { if (Math.random() > 0.6) { glitched += glitchChars[Math.floor(Math.random() * glitchChars.length)]; } else { glitched += originalText[i]; } } setGlitchText(glitched); setTimeout(() => setGlitchText(originalText), 150); } }, 400); return () => clearInterval(glitchInterval); }); const createParticles = () => { return Array.from({ length: 40 }, (_, i) => ({ id: i, left: `${Math.random() * 100}%`, top: `${Math.random() * 100}%`, animationDelay: `${Math.random() * 3}s`, animationDuration: `${2 + Math.random() * 3}s` })); }; return (
An unexpected error has disrupted the flow of ... something.
But don't worry, you can try again or navigate back to safety.
Error: {props.error.message}
)}System Error • Something went wrong