"use client"; import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, } from "@/components/ui/dialog"; import { OutputRender } from "./OutputRender"; import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from "@/components/ui/table"; import type { findAllRuns } from "@/server/findAllRuns"; import { getRunsOutput } from "@/server/getRunsOutput"; import { Button } from "@/components/ui/button"; import { ExternalLink } from "lucide-react"; import { LogsViewer } from "@/components/LogsViewer"; import { CopyButton } from "@/components/CopyButton"; import useSWR from "swr"; import { CodeBlockClient } from "@/components/CodeBlockClient"; export function RunOutputs({ run, }: { run: Awaited>[0] }) { const { data, isValidating, error } = useSWR( "run-outputs+" + run.id, async () => { return await getRunsOutput(run.id); }, ); return ( File Output Run log {run.run_log ? ( Run Log Copy ) : ( "No log available" )} {data?.map((run) => { const fileName = run.data.images?.[0].filename || run.data.files?.[0].filename || run.data.gifs?.[0].filename; if (!fileName) return ( Output ); // const filePath return ( {fileName} ); })}
); }