From d720feb63dfe739c3378b16931edcf721981ac26 Mon Sep 17 00:00:00 2001 From: Asim Shrestha Date: Fri, 7 Apr 2023 15:38:16 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=80=20Update=20input=20fields?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Badge.tsx | 2 +- src/components/Button.tsx | 2 +- src/components/ChatWindow.tsx | 12 ++++++--- src/components/Input.tsx | 24 ++++++++++++----- src/pages/index.tsx | 49 ++++++++++++++++++++++++++++++----- 5 files changed, 71 insertions(+), 18 deletions(-) diff --git a/src/components/Badge.tsx b/src/components/Badge.tsx index 387e327..8f28af0 100644 --- a/src/components/Badge.tsx +++ b/src/components/Badge.tsx @@ -6,7 +6,7 @@ interface BadgeProps { const Badge = ({ children }: BadgeProps) => { return ( -
+
{children}
); diff --git a/src/components/Button.tsx b/src/components/Button.tsx index 18e1a9a..4269dc6 100644 --- a/src/components/Button.tsx +++ b/src/components/Button.tsx @@ -33,7 +33,7 @@ const Button = forwardRef( disabled={loading || props.disabled} className={ // eslint-disable-next-line @typescript-eslint/restrict-plus-operands - "shadow-2xl transition-all " + props.className + "transition-all hover:shadow-2xl " + props.className } onClick={onClick} > diff --git a/src/components/ChatWindow.tsx b/src/components/ChatWindow.tsx index 7e0887f..76781ee 100644 --- a/src/components/ChatWindow.tsx +++ b/src/components/ChatWindow.tsx @@ -5,11 +5,17 @@ import React from "react"; interface ChatWindowProps { children?: ReactNode; + className: string; } -const ChatWindow = ({ children }: ChatWindowProps) => { +const ChatWindow = ({ children, className }: ChatWindowProps) => { return ( -
+
{children}
@@ -33,7 +39,7 @@ const ChatMessage = ({ message }: { message: Message }) => {
{message.type === "goal" ? "🌟 Embarking on a new goal: " : ""} - {message.type === "task" ? "📝 Adding to task list: " : ""} + {message.type === "task" ? "📝 Adding task: " : ""} {message.value}
diff --git a/src/components/Input.tsx b/src/components/Input.tsx index bf82c37..85b6413 100644 --- a/src/components/Input.tsx +++ b/src/components/Input.tsx @@ -1,18 +1,28 @@ import React from "react"; interface InputProps { + left: React.ReactNode; value: string; onChange: (e: React.ChangeEvent) => void; + placeholder?: string; } -const Input = ({ value, onChange }: InputProps) => { +const Input = ({ placeholder, left, value, onChange }: InputProps) => { return ( - +
+ {left != null ? ( +
+ {left} +
+ ) : null} + +
); }; diff --git a/src/pages/index.tsx b/src/pages/index.tsx index e269c09..a827dc9 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -7,6 +7,8 @@ import axios from "axios"; import Drawer from "../components/Drawer"; import Input from "../components/Input"; import Button from "../components/Button"; +import { AiFillRobot } from "react-icons/Ai"; +import { FaStar } from "react-icons/fa"; export interface Message { type: "goal" | "thinking" | "task" | "action"; @@ -23,6 +25,7 @@ const TaskMessage = (task: string) => { const Home: NextPage = () => { const [loading, setLoading] = React.useState(false); + const [name, setName] = React.useState(""); const [goalInput, setGoalInput] = React.useState(""); const [messages, setMessages] = React.useState([]); const [goal, setGoal] = React.useState(""); @@ -50,16 +53,23 @@ const Home: NextPage = () => {
-
-
- AgentGPT +
+
+ Agent + GPT + Beta 🚀 +
+
+ Autonomous AI Agents in your browser
- Beta 🚀
- + {messages.map((message, index) => ( ))} @@ -67,9 +77,29 @@ const Home: NextPage = () => { + + Name: + + } + value={name} + onChange={(e) => setName(e.target.value)} + placeholder="AgentGPT (Note: this field doesn't do anything right now)" + /> + + + + Goal: + + } value={goalInput} onChange={(e) => setGoalInput(e.target.value)} + placeholder="Make the world a better place." /> + {/* eslint-disable-next-line @typescript-eslint/no-misused-promises */} + +