11import { HomeIcon } from "@heroicons/react/20/solid" ;
22import { isRouteErrorResponse , useRouteError } from "@remix-run/react" ;
3- import { motion } from "framer-motion" ;
43import { friendlyErrorDisplay } from "~/utils/httpErrors" ;
54import { LinkButton } from "./primitives/Buttons" ;
65import { Header1 } from "./primitives/Headers" ;
76import { Paragraph } from "./primitives/Paragraph" ;
8- import { type ReactNode , useEffect , useState } from "react" ;
9-
10- declare global {
11- namespace JSX {
12- interface IntrinsicElements {
13- "spline-viewer" : React . DetailedHTMLProps <
14- React . HTMLAttributes < HTMLElement > & {
15- url ?: string ;
16- "loading-anim-type" ?: string ;
17- } ,
18- HTMLElement
19- > ;
20- }
21- }
22- }
7+ import { TriggerRotatingLogo } from "./TriggerRotatingLogo" ;
8+ import { type ReactNode } from "react" ;
239
2410type ErrorDisplayOptions = {
2511 button ?: {
@@ -56,23 +42,6 @@ type DisplayOptionsProps = {
5642} & ErrorDisplayOptions ;
5743
5844export function ErrorDisplay ( { title, message, button } : DisplayOptionsProps ) {
59- const [ isSplineReady , setIsSplineReady ] = useState ( false ) ;
60-
61- useEffect ( ( ) => {
62- // Already registered from a previous render
63- if ( customElements . get ( "spline-viewer" ) ) {
64- setIsSplineReady ( true ) ;
65- return ;
66- }
67-
68- const script = document . createElement ( "script" ) ;
69- script . type = "module" ;
70- script . src = "https://unpkg.com/@splinetool/[email protected] /build/spline-viewer.js" ; 71- script . onload = ( ) => setIsSplineReady ( true ) ;
72- // On error, we simply don't show the decorative viewer - no action needed
73- document . head . appendChild ( script ) ;
74- } , [ ] ) ;
75-
7645 return (
7746 < div className = "relative flex min-h-screen flex-col items-center justify-center bg-[#16181C]" >
7847 < div className = "z-10 mt-[30vh] flex flex-col items-center gap-8" >
@@ -87,20 +56,7 @@ export function ErrorDisplay({ title, message, button }: DisplayOptionsProps) {
8756 { button ? button . title : "Go to homepage" }
8857 </ LinkButton >
8958 </ div >
90- { isSplineReady && (
91- < motion . div
92- className = "pointer-events-none absolute inset-0 overflow-hidden"
93- initial = { { opacity : 0 } }
94- animate = { { opacity : 1 } }
95- transition = { { delay : 0.5 , duration : 2 , ease : "easeOut" } }
96- >
97- < spline-viewer
98- loading-anim-type = "spinner-small-light"
99- url = "https://prod.spline.design/wRly8TZN-e0Twb8W/scene.splinecode"
100- style = { { width : "100%" , height : "100%" } }
101- />
102- </ motion . div >
103- ) }
59+ < TriggerRotatingLogo />
10460 </ div >
10561 ) ;
10662}
0 commit comments