From 20644a83bcdf1b26a757ad010e425b22726bc58c Mon Sep 17 00:00:00 2001 From: Lucas Oliveira Date: Mon, 10 Jul 2023 19:24:02 -0300 Subject: [PATCH] Added placeholder message when a chat key does not exist --- src/frontend/src/index.css | 8 ++++++- .../src/modals/formModal/chatInput/index.tsx | 23 +++++++++++++++---- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/src/frontend/src/index.css b/src/frontend/src/index.css index de0839761..407db8fb5 100644 --- a/src/frontend/src/index.css +++ b/src/frontend/src/index.css @@ -917,11 +917,14 @@ The cursor: default; property value restores the browser's default cursor style .form-modal-lock-true { @apply bg-input text-black dark:bg-gray-700 dark:text-gray-300 } + .form-modal-no-input { + @apply bg-input text-center text-black dark:bg-gray-700 dark:text-gray-300 + } .form-modal-lock-false { @apply bg-white text-black dark:bg-gray-900 dark:text-gray-300 } .form-modal-lockchat { - @apply form-input block w-full rounded-md border-gray-300 p-4 pr-16 custom-scroll dark:border-gray-600 sm:text-sm + @apply form-input focus:ring-ring focus:border-ring block w-full rounded-md border-gray-300 p-4 pr-16 custom-scroll dark:border-gray-600 sm:text-sm } .form-modal-send-icon-position { @apply absolute bottom-2 right-4 @@ -935,6 +938,9 @@ The cursor: default; property value restores the browser's default cursor style .form-modal-send-icon { @apply mr-2 h-5 w-5 rotate-[44deg] } + .form-modal-play-icon { + @apply h-5 w-5 mx-1 + } .form-modal-chat-position { @apply flex-max-width px-2 py-6 pl-4 pr-9 } diff --git a/src/frontend/src/modals/formModal/chatInput/index.tsx b/src/frontend/src/modals/formModal/chatInput/index.tsx index 975a152f5..fa9637e1b 100644 --- a/src/frontend/src/modals/formModal/chatInput/index.tsx +++ b/src/frontend/src/modals/formModal/chatInput/index.tsx @@ -1,4 +1,4 @@ -import { Lock, LucideSend } from "lucide-react"; +import { Lock, LucideSend, Sparkles } from "lucide-react"; import { useEffect } from "react"; import { classNames } from "../../../utils"; @@ -49,24 +49,37 @@ export default function ChatInput({ setChatValue(e.target.value); }} className={classNames( - lockChat || noInput - ? " form-modal-lock-true bg-input " + lockChat + ? " form-modal-lock-true bg-input" + : noInput + ? "form-modal-no-input bg-input" : " form-modal-lock-false", + "form-modal-lockchat" )} - placeholder={"Send a message..."} + placeholder={ + noInput + ? "No chat input variables found. Click to run your flow." + : "Send a message..." + } />