Skip to content

Commit

Permalink
Revert "enhance: add icon for agents (#1399)" (#1452)
Browse files Browse the repository at this point in the history
This reverts commit 1337fea.
  • Loading branch information
cjellick authored Jan 25, 2025
1 parent 5c37345 commit 7d68806
Show file tree
Hide file tree
Showing 26 changed files with 104 additions and 859 deletions.
71 changes: 17 additions & 54 deletions ui/admin/app/components/agent/AgentForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { useEffect } from "react";
import { useForm } from "react-hook-form";
import { z } from "zod";

import { AgentIcon } from "~/components/agent/icon/AgentIcon";
import {
ControlledAutosizeTextarea,
ControlledInput,
Expand All @@ -19,14 +18,6 @@ const formSchema = z.object({
description: z.string().optional(),
prompt: z.string().optional(),
model: z.string().optional(),
icons: z
.object({
icon: z.string(),
iconDark: z.string(),
collapsed: z.string(),
collapsedDark: z.string(),
})
.optional(),
});

export type AgentInfoFormValues = z.infer<typeof formSchema>;
Expand All @@ -35,15 +26,9 @@ type AgentFormProps = {
agent: AgentInfoFormValues;
onSubmit?: (values: AgentInfoFormValues) => void;
onChange?: (values: AgentInfoFormValues) => void;
hideImageField?: boolean;
};

export function AgentForm({
agent,
onSubmit,
onChange,
hideImageField,
}: AgentFormProps) {
export function AgentForm({ agent, onSubmit, onChange }: AgentFormProps) {
const form = useForm<AgentInfoFormValues>({
resolver: zodResolver(formSchema),
mode: "onChange",
Expand All @@ -52,7 +37,6 @@ export function AgentForm({
description: agent.description || "",
prompt: agent.prompt || "",
model: agent.model || "",
icons: agent.icons,
},
});

Expand All @@ -79,20 +63,22 @@ export function AgentForm({
return (
<Form {...form}>
<form onSubmit={handleSubmit} className="space-y-4">
{hideImageField ? (
renderTitleDescription()
) : (
<div className="flex items-center justify-start gap-2">
<AgentIcon
name={agent.name}
icons={agent.icons}
onChange={(icons) => form.setValue("icons", icons)}
/>
<div className="flex flex-col gap-2">
{renderTitleDescription()}
</div>
</div>
)}
<ControlledInput
variant="ghost"
autoComplete="off"
control={form.control}
name="name"
className="text-3xl"
/>

<ControlledInput
variant="ghost"
control={form.control}
autoComplete="off"
name="description"
placeholder="Add a description..."
className="text-xl text-muted-foreground"
/>

<h4 className="flex items-center gap-2 border-b pb-2">
<BrainIcon className="h-5 w-5" />
Expand All @@ -112,27 +98,4 @@ export function AgentForm({
</form>
</Form>
);

function renderTitleDescription() {
return (
<>
<ControlledInput
variant="ghost"
autoComplete="off"
control={form.control}
name="name"
className="text-3xl"
/>

<ControlledInput
variant="ghost"
control={form.control}
autoComplete="off"
name="description"
placeholder="Add a description..."
className="text-xl text-muted-foreground"
/>
</>
);
}
}
146 changes: 0 additions & 146 deletions ui/admin/app/components/agent/icon/AgentIcon.tsx

This file was deleted.

Loading

0 comments on commit 7d68806

Please sign in to comment.