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() {
} type="submit">
اجرا
-
+
-
-
- نتیجه
-
-
+
+
);
}
diff --git a/components/tabs/textImagePanel.js b/components/tabs/textImagePanel.js
index 9ee449b..5306dd4 100644
--- a/components/tabs/textImagePanel.js
+++ b/components/tabs/textImagePanel.js
@@ -1,6 +1,5 @@
// components/PhoneInput.tsx
import {
- Box,
Button,
Divider,
FormControl,
@@ -8,13 +7,9 @@ import {
HStack,
Icon,
Input,
- Select,
Table,
- TableCaption,
TableContainer,
Tbody,
- Td,
- Text,
Textarea,
Th,
Thead,
@@ -28,6 +23,7 @@ import { TbPrompt } from "react-icons/tb";
import { FaDraft2Digital, FaPlay } from "react-icons/fa";
import { useState } from "react";
import { useForm } from "react-hook-form";
+import ResultBox from "../ui/ResultBox";
export default function TextImagePanel() {
const { register, handleSubmit } = useForm("");
@@ -136,28 +132,19 @@ export default function TextImagePanel() {
} type="submit">
اجرا
-
+
-
-
- نتیجه
-
-
+
+
);
}
diff --git a/components/tabs/textVideoPanel.js b/components/tabs/textVideoPanel.js
index a037cd7..3b7a788 100644
--- a/components/tabs/textVideoPanel.js
+++ b/components/tabs/textVideoPanel.js
@@ -1,6 +1,5 @@
// components/PhoneInput.tsx
import {
- Box,
Button,
Divider,
FormControl,
@@ -8,13 +7,9 @@ import {
HStack,
Icon,
Input,
- Select,
Table,
- TableCaption,
TableContainer,
Tbody,
- Td,
- Text,
Textarea,
Th,
Thead,
@@ -26,6 +21,7 @@ import { TbArrowGuide } from "react-icons/tb";
import { TbPrompt } from "react-icons/tb";
import { FaDraft2Digital, FaPlay } from "react-icons/fa";
import { useForm } from "react-hook-form";
+import ResultBox from "../ui/ResultBox";
export default function TextVideoPanel() {
const { register, handleSubmit } = useForm();
@@ -115,28 +111,19 @@ export default function TextVideoPanel() {
} type="submit">
اجرا
-
+
-
-
- نتیجه
-
-
+
+
);
}
diff --git a/components/ui/ResultBox.jsx b/components/ui/ResultBox.jsx
new file mode 100644
index 0000000..45d0bf8
--- /dev/null
+++ b/components/ui/ResultBox.jsx
@@ -0,0 +1,62 @@
+import { Box, HStack, Icon, Text } from "@chakra-ui/react";
+import { FaBolt } from "react-icons/fa";
+import ChatTypingLoader from "../loading/ChatTypingLoader";
+import {
+ IoDocumentTextOutline,
+ IoImageOutline,
+ IoVideocamOutline,
+} from "react-icons/io5";
+
+const iconsDic = {
+ llm: IoDocumentTextOutline,
+ image: IoImageOutline,
+ video: IoVideocamOutline,
+};
+
+function ResultBox({ type = "llm", loading = false, resultData = "" }) {
+ return (
+
+
+
+
+
+ نتیجه
+
+
+
+
+
+ {loading && (
+
+
+
+ )}
+
+
+ );
+}
+
+export default ResultBox;
diff --git a/pages/index.js b/pages/index.js
index cdebb2f..103fe8e 100644
--- a/pages/index.js
+++ b/pages/index.js
@@ -52,6 +52,13 @@ export default function Home() {
borderLeft="1px solid"
borderColor="gray.200"
py={8}
+ overflowY={"auto"}
+ maxH={"calc(100vh - 92px)"}
+ sx={{
+ "::-webkit-scrollbar": { display: "none" },
+ "scrollbar-width": "none",
+ "-ms-overflow-style": "none",
+ }}
>
{/* Menu */}
@@ -185,7 +192,18 @@ export default function Home() {
{/* Content */}
-
+