import type { ScopedThreadRef } from "@t3tools/contracts"; import ChatMarkdown from "~/components/ChatMarkdown"; import { resolvePathLinkTarget } from "~/terminal-links"; export function FileMarkdownPreview(props: { readonly cwd: string; readonly relativePath: string; readonly text: string; readonly threadRef: ScopedThreadRef; readonly onTaskListChange?: | ((input: { readonly markerOffset: number; readonly checked: boolean }) => void) | undefined; }) { const lastSeparator = Math.max( props.relativePath.lastIndexOf("/"), props.relativePath.lastIndexOf("\\"), ); const imageBaseDir = lastSeparator >= 0 ? resolvePathLinkTarget(props.relativePath.slice(0, lastSeparator), props.cwd) : props.cwd; return ( ); }