This commit is contained in:
marko-kraemer 2025-08-27 15:12:47 -07:00
parent 7d1c096c8c
commit 5c8a82ffc4
2 changed files with 17 additions and 11 deletions

View File

@ -22,20 +22,26 @@ export type FileType =
| 'csv' | 'csv'
| 'xlsx'; | 'xlsx';
interface FileRendererProps { export interface FileRendererProject {
content: string | null; id?: string;
binaryUrl: string | null; name?: string;
fileName: string; description?: string;
filePath?: string; created_at?: string;
className?: string;
project?: {
sandbox?: { sandbox?: {
id?: string; id?: string;
sandbox_url?: string; sandbox_url?: string;
vnc_preview?: string; vnc_preview?: string;
pass?: string; pass?: string;
}; };
}; }
interface FileRendererProps {
content: string | null;
binaryUrl: string | null;
fileName: string;
filePath?: string;
className?: string;
project?: FileRendererProject;
markdownRef?: React.RefObject<HTMLDivElement>; markdownRef?: React.RefObject<HTMLDivElement>;
onDownload?: () => void; onDownload?: () => void;
isDownloading?: boolean; isDownloading?: boolean;

View File

@ -9,7 +9,7 @@ import { ScrollArea } from '@/components/ui/scroll-area';
import { cn } from '@/lib/utils'; import { cn } from '@/lib/utils';
import { CodeRenderer } from './code-renderer'; import { CodeRenderer } from './code-renderer';
import { useImageContent } from '@/hooks/use-image-content'; import { useImageContent } from '@/hooks/use-image-content';
import type { Project } from '@/lib/api'; import type { FileRendererProject } from './index';
// Process Unicode escape sequences in content // Process Unicode escape sequences in content
export const processUnicodeContent = (content: string): string => { export const processUnicodeContent = (content: string): string => {
@ -36,7 +36,7 @@ interface AuthenticatedImageProps {
src: string; src: string;
alt?: string; alt?: string;
className?: string; className?: string;
project?: Project; project?: FileRendererProject;
} }
function AuthenticatedImage({ src, alt, className, project }: AuthenticatedImageProps) { function AuthenticatedImage({ src, alt, className, project }: AuthenticatedImageProps) {
@ -80,7 +80,7 @@ function AuthenticatedImage({ src, alt, className, project }: AuthenticatedImage
interface MarkdownRendererProps { interface MarkdownRendererProps {
content: string; content: string;
className?: string; className?: string;
project?: Project; project?: FileRendererProject;
} }
export const MarkdownRenderer = forwardRef< export const MarkdownRenderer = forwardRef<