// Copyright 2024, Command Line Inc. // SPDX-License-Identifier: Apache-2.0 import { FileInfo, FileService, FullFile } from "@/bindings/fileservice"; import { Markdown } from "@/element/markdown"; import { useBlockAtom, useBlockCache } from "@/store/global"; import * as WOS from "@/store/wos"; import * as util from "@/util/util"; import * as jotai from "jotai"; import { CenteredDiv } from "../element/quickelems"; import { DirectoryPreview } from "./directorypreview"; import "./view.less"; const MaxFileSize = 1024 * 1024 * 10; // 10MB function MarkdownPreview({ contentAtom }: { contentAtom: jotai.Atom> }) { const readmeText = jotai.useAtomValue(contentAtom); return (
); } function StreamingPreview({ fileInfo }: { fileInfo: FileInfo }) { const filePath = fileInfo.path; const streamingUrl = "/wave/stream-file?path=" + encodeURIComponent(filePath); if (fileInfo.mimetype == "application/pdf") { return (