/* ┌──────────────────────────────────────────────────────────────────────────────┐ │ @author: Davidson Gomes │ │ @file: /app/documentation/components/LabSection.tsx │ │ Developed by: Davidson Gomes │ │ Creation date: May 13, 2025 │ │ Contact: contato@evolution-api.com │ ├──────────────────────────────────────────────────────────────────────────────┤ │ @copyright © Evolution API 2025. All rights reserved. │ │ Licensed under the Apache License, Version 2.0 │ │ │ │ You may not use this file except in compliance with the License. │ │ You may obtain a copy of the License at │ │ │ │ http://www.apache.org/licenses/LICENSE-2.0 │ │ │ │ Unless required by applicable law or agreed to in writing, software │ │ distributed under the License is distributed on an "AS IS" BASIS, │ │ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. │ │ See the License for the specific language governing permissions and │ │ limitations under the License. │ ├──────────────────────────────────────────────────────────────────────────────┤ │ @important │ │ For any future changes to the code in this file, it is recommended to │ │ include, together with the modification, the information of the developer │ │ who changed it and the date of modification. │ └──────────────────────────────────────────────────────────────────────────────┘ */ import { useState } from "react"; import { Card, CardContent, CardHeader, CardTitle, CardDescription } from "@/components/ui/card"; import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; import { Button } from "@/components/ui/button"; import { ClipboardCopy } from "lucide-react"; import { HttpLabForm } from "@/app/documentation/components/HttpLabForm"; import { StreamLabForm } from "@/app/documentation/components/StreamLabForm"; import { CodeBlock } from "@/app/documentation/components/CodeBlock"; interface LabSectionProps { agentUrl: string; setAgentUrl: (url: string) => void; apiKey: string; setApiKey: (key: string) => void; message: string; setMessage: (message: string) => void; sessionId: string; setSessionId: (id: string) => void; taskId: string; setTaskId: (id: string) => void; callId: string; setCallId: (id: string) => void; a2aMethod: string; setA2aMethod: (method: string) => void; authMethod: string; setAuthMethod: (method: string) => void; generateNewIds: () => void; sendRequest: () => Promise; sendStreamRequestWithEventSource: () => Promise; isLoading: boolean; isStreaming: boolean; streamResponse: string; streamStatus: string; streamHistory: string[]; streamComplete: boolean; response: string; copyToClipboard: (text: string) => void; renderStatusIndicator: () => JSX.Element | null; renderTypingIndicator: () => JSX.Element | null; } export function LabSection({ agentUrl, setAgentUrl, apiKey, setApiKey, message, setMessage, sessionId, setSessionId, taskId, setTaskId, callId, setCallId, a2aMethod, setA2aMethod, authMethod, setAuthMethod, generateNewIds, sendRequest, sendStreamRequestWithEventSource, isLoading, isStreaming, streamResponse, streamStatus, streamHistory, streamComplete, response, copyToClipboard, renderStatusIndicator, renderTypingIndicator }: LabSectionProps) { const [labMode, setLabMode] = useState("http"); return ( <> A2A Test Lab Test your A2A agent with different communication methods HTTP Request Streaming {response && labMode === "http" && ( Response
)} ); }