import { Component, Show, JSX } from 'solid-js'; type SafeLinkProps = { class?: string; href: string; children?: JSX.Element; }; const SafeLink: Component = (props) => { const isSafe = () => { try { const url = new URL(props.href.toString()); return url.protocol === 'https:' || url.protocol === 'http:'; } catch { return false; } }; return ( {props.children ?? props.href} ); }; export default SafeLink;