import { asset } from "$fresh/runtime.ts"; import { Component, ContextType } from "preact"; import { GlobalCtx } from "./GlobalContext.tsx"; export type StyleSheetType = { href: string; }; export default class StyleSheet extends Component { static contextType = GlobalCtx; declare context: ContextType; render() { const href = this.props.href; if (this.context) { const sheets = this.context.stylesheets; if (sheets.has(href)) return null; sheets.add(href); } return ; } }