@greatapps/greatagents-ui 0.3.5 → 0.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -1
- package/dist/index.js +18 -18
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/agents/agent-form-dialog.tsx +12 -11
package/package.json
CHANGED
|
@@ -15,12 +15,14 @@ import {
|
|
|
15
15
|
} from "@greatapps/greatauth-ui/ui";
|
|
16
16
|
import { Loader2 } from "lucide-react";
|
|
17
17
|
import { toast } from "sonner";
|
|
18
|
+
import { ImageCropUpload } from "@greatapps/greatauth-ui";
|
|
18
19
|
|
|
19
20
|
interface AgentFormDialogProps {
|
|
20
21
|
config: GagentsHookConfig;
|
|
21
22
|
open: boolean;
|
|
22
23
|
onOpenChange: (open: boolean) => void;
|
|
23
24
|
agent?: Agent;
|
|
25
|
+
idAccount?: string | number | null;
|
|
24
26
|
}
|
|
25
27
|
|
|
26
28
|
interface FormState {
|
|
@@ -68,6 +70,7 @@ export function AgentFormDialog({
|
|
|
68
70
|
open,
|
|
69
71
|
onOpenChange,
|
|
70
72
|
agent,
|
|
73
|
+
idAccount,
|
|
71
74
|
}: AgentFormDialogProps) {
|
|
72
75
|
const isEditing = !!agent;
|
|
73
76
|
const createAgent = useCreateAgent(config);
|
|
@@ -139,19 +142,17 @@ export function AgentFormDialog({
|
|
|
139
142
|
</DialogTitle>
|
|
140
143
|
</DialogHeader>
|
|
141
144
|
<form onSubmit={handleSubmit} className="space-y-4">
|
|
142
|
-
<div className="
|
|
143
|
-
<
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
145
|
+
<div className="flex justify-center">
|
|
146
|
+
<ImageCropUpload
|
|
147
|
+
value={form.photo || null}
|
|
148
|
+
onChange={(url) => updateField("photo", url)}
|
|
149
|
+
onRemove={() => updateField("photo", "")}
|
|
150
|
+
entityType="agents"
|
|
151
|
+
entityId={agent?.id}
|
|
152
|
+
idAccount={typeof idAccount === "string" ? Number(idAccount) : (idAccount ?? Number(config.accountId) ?? 0)}
|
|
153
|
+
name={form.title || null}
|
|
150
154
|
disabled={isPending}
|
|
151
155
|
/>
|
|
152
|
-
<p className="text-xs text-muted-foreground">
|
|
153
|
-
URL da imagem de avatar do agente
|
|
154
|
-
</p>
|
|
155
156
|
</div>
|
|
156
157
|
<div className="space-y-2">
|
|
157
158
|
<Label htmlFor="agent-title">Nome do Agente *</Label>
|