import type { ReactNode } from "react"; import { ExternalLink } from "./external-link"; //const FileExtensionRegex = /\.([\w]+)$/i; interface HyperTextProps { link: string; children?: ReactNode; } export function HyperText({ link, children }: HyperTextProps) { /*try { const url = new URL(link); const extension = FileExtensionRegex.test(url.pathname.toLowerCase()) && RegExp.$1; if (extension) { switch (extension) { case "gif": case "jpg": case "jpeg": case "png": case "bmp": case "webp": { return {url.toString()}; } case "wav": case "mp3": case "ogg": { return