mirror of
https://github.com/privacy-scaling-explorations/pse.dev.git
synced 2026-01-09 14:18:02 -05:00
25 lines
597 B
TypeScript
25 lines
597 B
TypeScript
"use client"
|
|
|
|
import { useEffect, useState } from "react"
|
|
|
|
export function CSSLoader() {
|
|
const [loaded, setLoaded] = useState(false)
|
|
|
|
useEffect(() => {
|
|
// Load main CSS after critical render
|
|
const loadCSS = () => {
|
|
const link = document.createElement("link")
|
|
link.rel = "stylesheet"
|
|
link.href = "/globals.css"
|
|
link.onload = () => setLoaded(true)
|
|
document.head.appendChild(link)
|
|
}
|
|
|
|
// Load CSS after a short delay to not block initial render
|
|
const timer = setTimeout(loadCSS, 100)
|
|
return () => clearTimeout(timer)
|
|
}, [])
|
|
|
|
return null
|
|
}
|