import { FileExtensionRegex } from "Const"; import { ProxyImg } from "Element/ProxyImg"; export default function MediaLink({ link }: { link: string }) { const url = new URL(link); const extension = FileExtensionRegex.test(url.pathname.toLowerCase()) && RegExp.$1; switch (extension) { case "gif": case "jpg": case "jpeg": case "jfif": case "png": case "bmp": case "webp": { return ; } case "wav": case "mp3": case "ogg": { return