Skip to content

Commit 7d68806

Browse files
authored
Revert "enhance: add icon for agents (#1399)" (#1452)
This reverts commit 1337fea.
1 parent 5c37345 commit 7d68806

26 files changed

+104
-859
lines changed

ui/admin/app/components/agent/AgentForm.tsx

Lines changed: 17 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { useEffect } from "react";
44
import { useForm } from "react-hook-form";
55
import { z } from "zod";
66

7-
import { AgentIcon } from "~/components/agent/icon/AgentIcon";
87
import {
98
ControlledAutosizeTextarea,
109
ControlledInput,
@@ -19,14 +18,6 @@ const formSchema = z.object({
1918
description: z.string().optional(),
2019
prompt: z.string().optional(),
2120
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(),
3021
});
3122

3223
export type AgentInfoFormValues = z.infer<typeof formSchema>;
@@ -35,15 +26,9 @@ type AgentFormProps = {
3526
agent: AgentInfoFormValues;
3627
onSubmit?: (values: AgentInfoFormValues) => void;
3728
onChange?: (values: AgentInfoFormValues) => void;
38-
hideImageField?: boolean;
3929
};
4030

41-
export function AgentForm({
42-
agent,
43-
onSubmit,
44-
onChange,
45-
hideImageField,
46-
}: AgentFormProps) {
31+
export function AgentForm({ agent, onSubmit, onChange }: AgentFormProps) {
4732
const form = useForm<AgentInfoFormValues>({
4833
resolver: zodResolver(formSchema),
4934
mode: "onChange",
@@ -52,7 +37,6 @@ export function AgentForm({
5237
description: agent.description || "",
5338
prompt: agent.prompt || "",
5439
model: agent.model || "",
55-
icons: agent.icons,
5640
},
5741
});
5842

@@ -79,20 +63,22 @@ export function AgentForm({
7963
return (
8064
<Form {...form}>
8165
<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+
/>
9682

9783
<h4 className="flex items-center gap-2 border-b pb-2">
9884
<BrainIcon className="h-5 w-5" />
@@ -112,27 +98,4 @@ export function AgentForm({
11298
</form>
11399
</Form>
114100
);
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-
}
138101
}

ui/admin/app/components/agent/icon/AgentIcon.tsx

Lines changed: 0 additions & 146 deletions
This file was deleted.

0 commit comments

Comments
 (0)