import VideoPlayer from "./video-player"; import { createEffect, createSignal, For, Show } from "solid-js"; import { A } from "@solidjs/router"; import { pds } from "./navbar"; import Tooltip from "./tooltip"; import { hideMedia } from "./settings"; interface AtBlob { $type: string; ref: { $link: string }; mimeType: string; } const ATURI_RE = /^at:\/\/([a-zA-Z0-9._:%-]+)(?:\/([a-zA-Z0-9-.]+)(?:\/([a-zA-Z0-9._~:@!$&%')(*+,;=-]+))?)?(?:#(\/[a-zA-Z0-9._~:@!$&%')(*+,;=\-[\]/\\]*))?$/; const DID_RE = /^did:[a-z]+:[a-zA-Z0-9._:%-]*[a-zA-Z0-9._-]$/; const JSONString = ({ data }: { data: string }) => { const isURL = URL.canParse ?? ((url, base) => { try { new URL(url, base); return true; } catch { return false; } }); return ( " {(part) => ( <> {ATURI_RE.test(part) ? {part} : DID_RE.test(part) ? {part} : ( isURL(part) && ["http:", "https:", "web+at:"].includes(new URL(part).protocol) && part.split("\n").length === 1 ) ? {part} : part} )} " ); }; const JSONNumber = ({ data }: { data: number }) => { return {data}; }; const JSONBoolean = ({ data }: { data: boolean }) => { return {data ? "true" : "false"}; }; const JSONNull = () => { return null; }; const JSONObject = ({ data, repo }: { data: { [x: string]: JSONType }; repo: string }) => { const [hide, setHide] = createSignal(localStorage.hideMedia === "true"); createEffect(() => setHide(hideMedia())); const Obj = ({ key, value }: { key: string; value: JSONType }) => { const [show, setShow] = createSignal(true); return ( ); }; const rawObj = ( {([key, value]) => } ); const blob: AtBlob = data as any; if (blob.$type === "blob") { return ( <>