diff --git a/app/chat/page.tsx b/app/chat/page.tsx deleted file mode 100644 index 502e4b3..0000000 --- a/app/chat/page.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import React from "react"; -import Typography from "@mui/material/Typography"; -import Rhf from "@/components/Rhf"; - -export default function Home() { - return ( -
-
- Chat - -
-
- ); -} diff --git a/components/InputMessage.tsx b/components/InputMessage.tsx deleted file mode 100644 index d9a0c39..0000000 --- a/components/InputMessage.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import React from "react"; -import TextField from "@mui/material/TextField"; -import { Controller } from "react-hook-form"; - -type InputMessageProps = { - id: string; - label: string; - control: any; -}; - -export default function InputMessage(props: InputMessageProps) { - return ( - ( - - )} - /> - ); -} diff --git a/components/InputSlider.tsx b/components/InputSlider.tsx deleted file mode 100644 index 22998d1..0000000 --- a/components/InputSlider.tsx +++ /dev/null @@ -1,38 +0,0 @@ -import React from "react"; -import { Controller } from "react-hook-form"; -import { InputLabel } from "@mui/material"; -import Slider from "@mui/material/Slider"; - -type SliderProps = { - control: any; - id: string; - label: string; - min: number; - max: number; - step: number; - defaultValue: number; -}; - -export default function InputSlider(props: SliderProps) { - return ( - ( -
- {props.label} - -
- )} - /> - ); -} diff --git a/components/ModelSelect.tsx b/components/ModelSelect.tsx deleted file mode 100644 index 49990e1..0000000 --- a/components/ModelSelect.tsx +++ /dev/null @@ -1,33 +0,0 @@ -import React from "react"; -import MenuItem from "@mui/material/MenuItem"; -import ListSubheader from "@mui/material/ListSubheader"; -import Select from "@mui/material/Select"; -import { Controller } from "react-hook-form"; -import { InputLabel } from "@mui/material"; - -interface ModelSelectProps { - id: string; - label: string; - control: any; -} - -export default function ModelSelect(props: ModelSelectProps) { - return ( - ( -
- Model - -
- )} - /> - ); -} diff --git a/components/Rhf.tsx b/components/Rhf.tsx deleted file mode 100644 index e078caa..0000000 --- a/components/Rhf.tsx +++ /dev/null @@ -1,97 +0,0 @@ -"use client"; - -import React from "react"; -import { useState } from "react"; -import { useForm, SubmitHandler } from "react-hook-form"; -import InputMessage from "./InputMessage"; -import Slider from "./InputSlider"; -import ModelSelect from "./ModelSelect"; -import SendButton from "./SendButton"; - -type Inputs = { - model: string; - temperature: number; - maxTokens: number; - topK: number; - message: string; -}; - -export default function Rhf() { - const [data, setData] = useState(); - - // Initialize the useForm hook from react-hook-form - const { - control, - handleSubmit, - formState: { errors }, - } = useForm({ - defaultValues: { - model: "gpt-3.5-turbo", - temperature: 1, - maxTokens: 256, - topK: 2, - message: "", - }, - }); - - // This is where you'd send the data to your API - const processForm: SubmitHandler = (data) => { - setData(data); - console.log(data); - // Process the form data here (e.g., send it to an API) - }; - - return ( -
-
- - - - - - - - -
- -
- - - -
-
{JSON.stringify(data, null, 2)}
-
-
- ); -} diff --git a/components/SecretInput.tsx b/components/SecretInput.tsx deleted file mode 100644 index 8b4bc8f..0000000 --- a/components/SecretInput.tsx +++ /dev/null @@ -1,51 +0,0 @@ -import React from "react"; -import IconButton from "@mui/material/IconButton"; -import OutlinedInput from "@mui/material/OutlinedInput"; -import InputLabel from "@mui/material/InputLabel"; -import InputAdornment from "@mui/material/InputAdornment"; -import FormHelperText from "@mui/material/FormHelperText"; -import TextField from "@mui/material/TextField"; -import Visibility from "@mui/icons-material/Visibility"; -import VisibilityOff from "@mui/icons-material/VisibilityOff"; - -interface SecretInputProps { - label: string; - id: string; -} - -export default function SecretInput(props: SecretInputProps) { - const [showPassword, setShowPassword] = React.useState(false); - - const handleClickShowPassword = () => setShowPassword((show) => !show); - - const handleMouseDownPassword = ( - event: React.MouseEvent - ) => { - event.preventDefault(); - }; - - return ( -
- - {props.label} - - - - {showPassword ? : } - - - } - label={props.label} - /> -
- ); -} diff --git a/components/SendButton.tsx b/components/SendButton.tsx deleted file mode 100644 index 3965fa9..0000000 --- a/components/SendButton.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import React from "react"; -import { Controller } from "react-hook-form"; -import { Button } from "@mui/material"; -import SendIcon from "@mui/icons-material/Send"; - -interface SendButtonProps { - id: string; - control: any; - onClick: any; -} - -export default function SendButton(props: SendButtonProps) { - return ( - ( - - )} - /> - ); -} diff --git a/package.json b/package.json index ea89f32..10a358b 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "react": "^18", "react-dom": "^18", "react-hook-form": "^7.47.0", + "react-icons": "^4.11.0", "zod": "^3.22.4" }, "devDependencies": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fb75547..e122062 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -35,6 +35,9 @@ dependencies: react-hook-form: specifier: ^7.47.0 version: 7.47.0(react@18.2.0) + react-icons: + specifier: ^4.11.0 + version: 4.11.0(react@18.2.0) zod: specifier: ^3.22.4 version: 3.22.4 @@ -2610,6 +2613,14 @@ packages: react: 18.2.0 dev: false + /react-icons@4.11.0(react@18.2.0): + resolution: {integrity: sha512-V+4khzYcE5EBk/BvcuYRq6V/osf11ODUM2J8hg2FDSswRrGvqiYUYPRy4OdrWaQOBj4NcpJfmHZLNaD+VH0TyA==} + peerDependencies: + react: '*' + dependencies: + react: 18.2.0 + dev: false + /react-is@16.13.1: resolution: {integrity: sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==}