@@ -4,7 +4,6 @@ import { useEffect } from "react";
4
4
import { useForm } from "react-hook-form" ;
5
5
import { z } from "zod" ;
6
6
7
- import { AgentIcon } from "~/components/agent/icon/AgentIcon" ;
8
7
import {
9
8
ControlledAutosizeTextarea ,
10
9
ControlledInput ,
@@ -19,14 +18,6 @@ const formSchema = z.object({
19
18
description : z . string ( ) . optional ( ) ,
20
19
prompt : z . string ( ) . optional ( ) ,
21
20
model : z . string ( ) . optional ( ) ,
22
- icons : z
23
- . object ( {
24
- icon : z . string ( ) ,
25
- iconDark : z . string ( ) ,
26
- collapsed : z . string ( ) ,
27
- collapsedDark : z . string ( ) ,
28
- } )
29
- . optional ( ) ,
30
21
} ) ;
31
22
32
23
export type AgentInfoFormValues = z . infer < typeof formSchema > ;
@@ -35,15 +26,9 @@ type AgentFormProps = {
35
26
agent : AgentInfoFormValues ;
36
27
onSubmit ?: ( values : AgentInfoFormValues ) => void ;
37
28
onChange ?: ( values : AgentInfoFormValues ) => void ;
38
- hideImageField ?: boolean ;
39
29
} ;
40
30
41
- export function AgentForm ( {
42
- agent,
43
- onSubmit,
44
- onChange,
45
- hideImageField,
46
- } : AgentFormProps ) {
31
+ export function AgentForm ( { agent, onSubmit, onChange } : AgentFormProps ) {
47
32
const form = useForm < AgentInfoFormValues > ( {
48
33
resolver : zodResolver ( formSchema ) ,
49
34
mode : "onChange" ,
@@ -52,7 +37,6 @@ export function AgentForm({
52
37
description : agent . description || "" ,
53
38
prompt : agent . prompt || "" ,
54
39
model : agent . model || "" ,
55
- icons : agent . icons ,
56
40
} ,
57
41
} ) ;
58
42
@@ -79,20 +63,22 @@ export function AgentForm({
79
63
return (
80
64
< Form { ...form } >
81
65
< form onSubmit = { handleSubmit } className = "space-y-4" >
82
- { hideImageField ? (
83
- renderTitleDescription ( )
84
- ) : (
85
- < div className = "flex items-center justify-start gap-2" >
86
- < AgentIcon
87
- name = { agent . name }
88
- icons = { agent . icons }
89
- onChange = { ( icons ) => form . setValue ( "icons" , icons ) }
90
- />
91
- < div className = "flex flex-col gap-2" >
92
- { renderTitleDescription ( ) }
93
- </ div >
94
- </ div >
95
- ) }
66
+ < ControlledInput
67
+ variant = "ghost"
68
+ autoComplete = "off"
69
+ control = { form . control }
70
+ name = "name"
71
+ className = "text-3xl"
72
+ />
73
+
74
+ < ControlledInput
75
+ variant = "ghost"
76
+ control = { form . control }
77
+ autoComplete = "off"
78
+ name = "description"
79
+ placeholder = "Add a description..."
80
+ className = "text-xl text-muted-foreground"
81
+ />
96
82
97
83
< h4 className = "flex items-center gap-2 border-b pb-2" >
98
84
< BrainIcon className = "h-5 w-5" />
@@ -112,27 +98,4 @@ export function AgentForm({
112
98
</ form >
113
99
</ Form >
114
100
) ;
115
-
116
- function renderTitleDescription ( ) {
117
- return (
118
- < >
119
- < ControlledInput
120
- variant = "ghost"
121
- autoComplete = "off"
122
- control = { form . control }
123
- name = "name"
124
- className = "text-3xl"
125
- />
126
-
127
- < ControlledInput
128
- variant = "ghost"
129
- control = { form . control }
130
- autoComplete = "off"
131
- name = "description"
132
- placeholder = "Add a description..."
133
- className = "text-xl text-muted-foreground"
134
- />
135
- </ >
136
- ) ;
137
- }
138
101
}
0 commit comments