"use client"; import { Terminal } from "lucide-react"; import { ScrollArea } from "@/components/ui/scroll-area"; import { type } from "@/lib/typography"; import { cn } from "@/lib/utils"; import type { InteractionLog } from "./types"; interface PlaygroundOutputPanelProps { latestLog: InteractionLog | null; logs: InteractionLog[]; } export function PlaygroundOutputPanel({ latestLog, logs }: PlaygroundOutputPanelProps) { const preview = latestLog ? { interactionId: latestLog.id, model: latestLog.model, mode: latestLog.responseMode, durationMs: latestLog.durationMs, user: latestLog.userMessage, assistant: latestLog.assistantMessage, timestamp: latestLog.timestamp, } : null; return (
آخرین پاسخ
{preview ? (
            {JSON.stringify(preview, null, 2)}
          
) : (

هنوز تعاملی ثبت نشده است. یک پیام ارسال کنید تا خروجی ساختاریافته اینجا نمایش داده شود.

)}

لاگ اجرا

{logs.length === 0 ? (

لاگی برای نمایش وجود ندارد.

) : ( logs .slice() .reverse() .map((log) => (

{new Date(log.timestamp).toLocaleTimeString("fa-IR")}

مدل: {log.model} · مدت: {log.durationMs}ms

{log.userMessage}

)) )}
); }