Remove Agents screen
This commit is contained in:
+1
-5
@@ -5,11 +5,9 @@ import { ThemeProvider } from "next-themes";
|
|||||||
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
||||||
import { BrowserRouter, Routes, Route } from "react-router-dom";
|
import { BrowserRouter, Routes, Route } from "react-router-dom";
|
||||||
import { AppLayout } from "./components/layout/AppLayout";
|
import { AppLayout } from "./components/layout/AppLayout";
|
||||||
import Agents from "./pages/Agents";
|
|
||||||
import Prompts from "./pages/Prompts";
|
import Prompts from "./pages/Prompts";
|
||||||
import TestPrompt from "./pages/TestPrompt";
|
import TestPrompt from "./pages/TestPrompt";
|
||||||
import History from "./pages/History";
|
import History from "./pages/History";
|
||||||
import LinkPrompt from "./pages/LinkPrompt";
|
|
||||||
import NotFound from "./pages/NotFound";
|
import NotFound from "./pages/NotFound";
|
||||||
|
|
||||||
const queryClient = new QueryClient();
|
const queryClient = new QueryClient();
|
||||||
@@ -23,11 +21,9 @@ const App = () => (
|
|||||||
<BrowserRouter>
|
<BrowserRouter>
|
||||||
<Routes>
|
<Routes>
|
||||||
<Route element={<AppLayout />}>
|
<Route element={<AppLayout />}>
|
||||||
<Route path="/" element={<Agents />} />
|
<Route path="/" element={<Prompts />} />
|
||||||
<Route path="/prompts" element={<Prompts />} />
|
|
||||||
<Route path="/test" element={<TestPrompt />} />
|
<Route path="/test" element={<TestPrompt />} />
|
||||||
<Route path="/history" element={<History />} />
|
<Route path="/history" element={<History />} />
|
||||||
<Route path="/link" element={<LinkPrompt />} />
|
|
||||||
</Route>
|
</Route>
|
||||||
{/* ADD ALL CUSTOM ROUTES ABOVE THE CATCH-ALL "*" ROUTE */}
|
{/* ADD ALL CUSTOM ROUTES ABOVE THE CATCH-ALL "*" ROUTE */}
|
||||||
<Route path="*" element={<NotFound />} />
|
<Route path="*" element={<NotFound />} />
|
||||||
|
|||||||
@@ -1,48 +0,0 @@
|
|||||||
import { Bot, ExternalLink } from "lucide-react";
|
|
||||||
import { Card } from "@/components/ui/card";
|
|
||||||
import { Button } from "@/components/ui/button";
|
|
||||||
import { Badge } from "@/components/ui/badge";
|
|
||||||
|
|
||||||
interface AgentCardProps {
|
|
||||||
name: string;
|
|
||||||
description: string;
|
|
||||||
promptName?: string;
|
|
||||||
status: "active" | "inactive";
|
|
||||||
onLinkPrompt: () => void;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function AgentCard({ name, description, promptName, status, onLinkPrompt }: AgentCardProps) {
|
|
||||||
return (
|
|
||||||
<Card className="p-6 hover:shadow-hover transition-all duration-200 animate-fade-in">
|
|
||||||
<div className="flex items-start justify-between mb-4">
|
|
||||||
<div className="flex items-center gap-3">
|
|
||||||
<div className="h-12 w-12 rounded-lg bg-primary/10 flex items-center justify-center">
|
|
||||||
<Bot className="h-6 w-6 text-primary" />
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<h3 className="font-semibold text-foreground">{name}</h3>
|
|
||||||
<Badge variant={status === "active" ? "default" : "secondary"} className="mt-1">
|
|
||||||
{status === "active" ? "Ativo" : "Inativo"}
|
|
||||||
</Badge>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<p className="text-sm text-muted-foreground mb-4">{description}</p>
|
|
||||||
|
|
||||||
{promptName ? (
|
|
||||||
<div className="flex items-center justify-between p-3 bg-muted rounded-lg">
|
|
||||||
<div>
|
|
||||||
<p className="text-xs text-muted-foreground">Prompt vinculado</p>
|
|
||||||
<p className="text-sm font-medium text-foreground">{promptName}</p>
|
|
||||||
</div>
|
|
||||||
<ExternalLink className="h-4 w-4 text-muted-foreground" />
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
<Button onClick={onLinkPrompt} variant="outline" className="w-full">
|
|
||||||
Vincular Prompt
|
|
||||||
</Button>
|
|
||||||
)}
|
|
||||||
</Card>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,11 +1,9 @@
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { NavLink } from "react-router-dom";
|
import { NavLink } from "react-router-dom";
|
||||||
import {
|
import {
|
||||||
Bot,
|
|
||||||
FileText,
|
FileText,
|
||||||
TestTube,
|
TestTube,
|
||||||
History,
|
History,
|
||||||
Link,
|
|
||||||
ArrowLeft,
|
ArrowLeft,
|
||||||
ChevronLeft,
|
ChevronLeft,
|
||||||
ChevronRight,
|
ChevronRight,
|
||||||
@@ -15,11 +13,9 @@ import { Separator } from "@/components/ui/separator";
|
|||||||
import { ThemeToggle } from "./ThemeToggle";
|
import { ThemeToggle } from "./ThemeToggle";
|
||||||
|
|
||||||
const menuItems = [
|
const menuItems = [
|
||||||
{ title: "Agentes", url: "/", icon: Bot },
|
{ title: "Prompts", url: "/", icon: FileText },
|
||||||
{ title: "Prompts", url: "/prompts", icon: FileText },
|
|
||||||
{ title: "Testar Prompt", url: "/test", icon: TestTube },
|
{ title: "Testar Prompt", url: "/test", icon: TestTube },
|
||||||
{ title: "Histórico", url: "/history", icon: History },
|
{ title: "Histórico", url: "/history", icon: History },
|
||||||
{ title: "Vincular", url: "/link", icon: Link },
|
|
||||||
];
|
];
|
||||||
|
|
||||||
export function AppSidebar() {
|
export function AppSidebar() {
|
||||||
|
|||||||
@@ -1,59 +0,0 @@
|
|||||||
import { useState } from "react";
|
|
||||||
import { AgentCard } from "@/components/agents/AgentCard";
|
|
||||||
import { Button } from "@/components/ui/button";
|
|
||||||
import { Plus } from "lucide-react";
|
|
||||||
|
|
||||||
export default function Agents() {
|
|
||||||
const [agents] = useState([
|
|
||||||
{
|
|
||||||
id: 1,
|
|
||||||
name: "Agente de Suporte",
|
|
||||||
description: "Responde dúvidas de clientes sobre produtos e serviços da empresa",
|
|
||||||
promptName: "Prompt de Atendimento v2.1",
|
|
||||||
status: "active" as const,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 2,
|
|
||||||
name: "Agente de Vendas",
|
|
||||||
description: "Qualifica leads e apresenta produtos de forma personalizada",
|
|
||||||
promptName: "Prompt de Vendas v1.5",
|
|
||||||
status: "active" as const,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 3,
|
|
||||||
name: "Agente de Análise",
|
|
||||||
description: "Analisa dados e gera insights para tomada de decisão",
|
|
||||||
status: "inactive" as const,
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className="animate-fade-in">
|
|
||||||
<div className="flex items-center justify-between mb-8">
|
|
||||||
<div>
|
|
||||||
<h1 className="text-3xl font-bold text-foreground mb-2">Agentes de IA</h1>
|
|
||||||
<p className="text-muted-foreground">
|
|
||||||
Gerencie os agentes de IA e seus prompts vinculados
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<Button className="gap-2">
|
|
||||||
<Plus className="h-4 w-4" />
|
|
||||||
Novo Agente
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
|
||||||
{agents.map((agent) => (
|
|
||||||
<AgentCard
|
|
||||||
key={agent.id}
|
|
||||||
name={agent.name}
|
|
||||||
description={agent.description}
|
|
||||||
promptName={agent.promptName}
|
|
||||||
status={agent.status}
|
|
||||||
onLinkPrompt={() => console.log("Link prompt", agent.id)}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,117 +0,0 @@
|
|||||||
import { useState } from "react";
|
|
||||||
import { Card } from "@/components/ui/card";
|
|
||||||
import { Button } from "@/components/ui/button";
|
|
||||||
import { Label } from "@/components/ui/label";
|
|
||||||
import { Link as LinkIcon, Check } from "lucide-react";
|
|
||||||
import {
|
|
||||||
Select,
|
|
||||||
SelectContent,
|
|
||||||
SelectItem,
|
|
||||||
SelectTrigger,
|
|
||||||
SelectValue,
|
|
||||||
} from "@/components/ui/select";
|
|
||||||
import { useToast } from "@/hooks/use-toast";
|
|
||||||
|
|
||||||
export default function LinkPrompt() {
|
|
||||||
const [selectedAgent, setSelectedAgent] = useState("");
|
|
||||||
const [selectedPrompt, setSelectedPrompt] = useState("");
|
|
||||||
const { toast } = useToast();
|
|
||||||
|
|
||||||
const handleLink = () => {
|
|
||||||
if (selectedAgent && selectedPrompt) {
|
|
||||||
toast({
|
|
||||||
title: "Prompt vinculado com sucesso!",
|
|
||||||
description: "O agente já está usando o novo prompt.",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className="animate-fade-in max-w-3xl mx-auto">
|
|
||||||
<div className="mb-8">
|
|
||||||
<h1 className="text-3xl font-bold text-foreground mb-2">
|
|
||||||
Vincular Prompt ao Agente
|
|
||||||
</h1>
|
|
||||||
<p className="text-muted-foreground">
|
|
||||||
Associe um prompt específico a um agente de IA
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<Card className="p-8">
|
|
||||||
<div className="space-y-6">
|
|
||||||
<div>
|
|
||||||
<Label htmlFor="agent-select">Selecione o Agente</Label>
|
|
||||||
<Select value={selectedAgent} onValueChange={setSelectedAgent}>
|
|
||||||
<SelectTrigger id="agent-select">
|
|
||||||
<SelectValue placeholder="Escolha um agente" />
|
|
||||||
</SelectTrigger>
|
|
||||||
<SelectContent>
|
|
||||||
<SelectItem value="suporte">Agente de Suporte</SelectItem>
|
|
||||||
<SelectItem value="vendas">Agente de Vendas</SelectItem>
|
|
||||||
<SelectItem value="analise">Agente de Análise</SelectItem>
|
|
||||||
</SelectContent>
|
|
||||||
</Select>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<Label htmlFor="prompt-select">Selecione o Prompt</Label>
|
|
||||||
<Select value={selectedPrompt} onValueChange={setSelectedPrompt}>
|
|
||||||
<SelectTrigger id="prompt-select">
|
|
||||||
<SelectValue placeholder="Escolha um prompt" />
|
|
||||||
</SelectTrigger>
|
|
||||||
<SelectContent>
|
|
||||||
<SelectItem value="atendimento">
|
|
||||||
Prompt de Atendimento v2.1
|
|
||||||
</SelectItem>
|
|
||||||
<SelectItem value="vendas">Prompt de Vendas v1.5</SelectItem>
|
|
||||||
<SelectItem value="analise">Prompt de Análise</SelectItem>
|
|
||||||
<SelectItem value="marketing">Prompt de Marketing</SelectItem>
|
|
||||||
</SelectContent>
|
|
||||||
</Select>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{selectedAgent && selectedPrompt && (
|
|
||||||
<Card className="p-4 bg-muted animate-scale-in">
|
|
||||||
<h3 className="font-medium text-foreground mb-2">Resumo da Vinculação</h3>
|
|
||||||
<div className="space-y-2 text-sm">
|
|
||||||
<div className="flex justify-between">
|
|
||||||
<span className="text-muted-foreground">Agente:</span>
|
|
||||||
<span className="text-foreground font-medium">
|
|
||||||
{selectedAgent === "suporte" && "Agente de Suporte"}
|
|
||||||
{selectedAgent === "vendas" && "Agente de Vendas"}
|
|
||||||
{selectedAgent === "analise" && "Agente de Análise"}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div className="flex justify-between">
|
|
||||||
<span className="text-muted-foreground">Prompt:</span>
|
|
||||||
<span className="text-foreground font-medium">
|
|
||||||
{selectedPrompt === "atendimento" && "Prompt de Atendimento v2.1"}
|
|
||||||
{selectedPrompt === "vendas" && "Prompt de Vendas v1.5"}
|
|
||||||
{selectedPrompt === "analise" && "Prompt de Análise"}
|
|
||||||
{selectedPrompt === "marketing" && "Prompt de Marketing"}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div className="flex justify-between">
|
|
||||||
<span className="text-muted-foreground">Data:</span>
|
|
||||||
<span className="text-foreground font-medium">
|
|
||||||
{new Date().toLocaleDateString("pt-BR")}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</Card>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<Button
|
|
||||||
onClick={handleLink}
|
|
||||||
disabled={!selectedAgent || !selectedPrompt}
|
|
||||||
className="w-full gap-2"
|
|
||||||
size="lg"
|
|
||||||
>
|
|
||||||
<LinkIcon className="h-4 w-4" />
|
|
||||||
Vincular Prompt
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
</Card>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user