diff --git a/src/components/agents/SaveVersionDialog.tsx b/src/components/agents/SaveVersionDialog.tsx new file mode 100644 index 0000000..b462606 --- /dev/null +++ b/src/components/agents/SaveVersionDialog.tsx @@ -0,0 +1,126 @@ +import { Button } from "@/components/ui/button"; +import { + Dialog, + DialogContent, + DialogDescription, + DialogFooter, + DialogHeader, + DialogTitle, +} from "@/components/ui/dialog"; +import { Textarea } from "@/components/ui/textarea"; +import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"; +import { Label } from "@/components/ui/label"; +import { useState } from "react"; +import { AlertCircle } from "lucide-react"; + +interface SaveVersionDialogProps { + open: boolean; + onOpenChange: (open: boolean) => void; + onSave: (versionType: "major" | "minor" | "patch", notes: string) => void; +} + +export function SaveVersionDialog({ + open, + onOpenChange, + onSave, +}: SaveVersionDialogProps) { + const [versionType, setVersionType] = useState<"major" | "minor" | "patch">("minor"); + const [notes, setNotes] = useState(""); + + const handleSave = () => { + onSave(versionType, notes); + setNotes(""); + setVersionType("minor"); + onOpenChange(false); + }; + + const versionInfo = { + major: { + title: "Major", + description: "Use quando fizer mudanças significativas ou incompatíveis no comportamento do agente", + example: "Ex: Mudança completa na personalidade ou objetivo do agente", + }, + minor: { + title: "Minor", + description: "Use quando adicionar funcionalidades ou melhorias que não quebram o comportamento atual", + example: "Ex: Adicionar novas instruções ou melhorar respostas", + }, + patch: { + title: "Patch", + description: "Use para pequenos ajustes, correções ou refinamentos", + example: "Ex: Correção de erros gramaticais ou pequenos ajustes de tom", + }, + }; + + return ( + + + + Salvar Nova Versão + + Documente as alterações realizadas no agente + + + +
+ {/* Tipo de Versão */} +
+ + +
+ + {/* Explicação do tipo selecionado */} +
+
+ +
+

+ {versionInfo[versionType].title} +

+

+ {versionInfo[versionType].description} +

+

+ {versionInfo[versionType].example} +

+
+
+
+ + {/* Notas da Versão */} +
+ +