import { CreateScriptResponse, isShellRuntime, getSourceCommand } from '../types' import CommandCard from './CommandCard' interface Props { result: CreateScriptResponse onReset: () => void } export default function ResultCard({ result, onReset }: Props) { const detailUrl = `${window.location.origin}/s/${result.id}` const showSource = isShellRuntime(result.runtime) const sourceCommand = showSource ? getSourceCommand(result.url, result.runtime) : null return (

运行链接已生成

{showSource && sourceCommand && (

如果脚本设置了环境变量(如代理),请使用以下命令在当前 shell 中执行:

)}
脚本 ID {result.id}
运行环境 {result.runtime}
过期时间 {new Date(result.expires_at).toLocaleString('zh-CN')}
详情页 {detailUrl}
管理令牌(请妥善保存,仅此一次)
{result.admin_token}
查看详情
) }