From 9faecb783afb4063d36660505ec9adc55eb33df2 Mon Sep 17 00:00:00 2001 From: Hossein Salari Date: Wed, 25 Feb 2026 14:18:01 +0330 Subject: [PATCH] refactor: improve some styles, develop ResultBox component & use it at all panels --- components/loading/ChatTypingLoader.js | 34 ++++++++++++++ components/tabs/llmPanel.js | 23 +++------- components/tabs/textImagePanel.js | 23 +++------- components/tabs/textVideoPanel.js | 23 +++------- components/ui/ResultBox.jsx | 62 ++++++++++++++++++++++++++ pages/index.js | 20 ++++++++- 6 files changed, 130 insertions(+), 55 deletions(-) create mode 100644 components/loading/ChatTypingLoader.js create mode 100644 components/ui/ResultBox.jsx diff --git a/components/loading/ChatTypingLoader.js b/components/loading/ChatTypingLoader.js new file mode 100644 index 0000000..bdf2b43 --- /dev/null +++ b/components/loading/ChatTypingLoader.js @@ -0,0 +1,34 @@ +import { Box } from "@chakra-ui/react"; +import { keyframes } from "@emotion/react"; + +const pulse = keyframes` + 0% { + transform: scale(0.7); + opacity: 0.4; + box-shadow: 0 0 0 0 rgba(147, 51, 234, 0.4); + } + 50% { + transform: scale(1); + opacity: 1; + box-shadow: 0 0 0 8px rgba(147, 51, 234, 0); + } + 100% { + transform: scale(0.7); + opacity: 0.4; + box-shadow: 0 0 0 0 rgba(147, 51, 234, 0); + } +`; + +const ChatTypingLoader = ({ size = "10px", color = "purple.400" }) => { + return ( + + ); +}; + +export default ChatTypingLoader; diff --git a/components/tabs/llmPanel.js b/components/tabs/llmPanel.js index 6256041..e7c3dd4 100644 --- a/components/tabs/llmPanel.js +++ b/components/tabs/llmPanel.js @@ -7,13 +7,9 @@ import { HStack, Icon, Input, - Select, Table, - TableCaption, TableContainer, Tbody, - Td, - Text, Textarea, Th, Thead, @@ -23,8 +19,8 @@ import { import { TbMathMax, TbPrompt } from "react-icons/tb"; import { FaDraft2Digital } from "react-icons/fa"; import { FaPlay } from "react-icons/fa"; -import { MdOutlineQuestionAnswer } from "react-icons/md"; import { useForm } from "react-hook-form"; +import ResultBox from "../ui/ResultBox"; export default function LlmPanel() { const { register, handleSubmit } = useForm(); @@ -94,28 +90,19 @@ export default function LlmPanel() { - + - +
ردیفردیف
- - - نتیجه -