import { Loader2 } from 'lucide-react' import ScriptPreview from './ScriptPreview' export interface ShellExecutePreviewProps { /** shell_execute 的输出文本(已做 ANSI 处理) */ output: string /** 顶部和终端中展示的工具名称,默认 shell_execute */ toolLabel?: string /** 是否处于加载中(统一在终端里展示 loading) */ loading?: boolean } export function ShellExecutePreview({ output, toolLabel = 'shell_execute', loading = false, }: ShellExecutePreviewProps) { const safeOutput = output || 'No output' if (loading) { return (
) } return (
{/* 右侧主体区域 */}
{/* 内容区域:一张终端卡片 */}
{/* 终端卡片,主进场:从下浮现 + 略微缩放 */}
bash — {toolLabel}
$ {toolLabel}
) }