import { useState } from "react"; import { ChevronDown, ChevronRight, Terminal } from "lucide-react"; import { Card } from "./ui/Card"; import { Button } from "./ui/Button"; interface LogViewerProps { logs: string[]; defaultExpanded?: boolean; } export function LogViewer({ logs, defaultExpanded = false }: LogViewerProps) { const [isExpanded, setIsExpanded] = useState(defaultExpanded); if (!logs || logs.length === 0) { return null; } return (
setIsExpanded(!isExpanded)} >
Patch Log {logs.length} entries
{isExpanded && (
{logs.map((log, index) => (
{(index + 1).toString().padStart(2, "0")} {log}
))}
)}
); }