Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merging Branch adi #1

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { useState } from 'react'
import reactLogo from './assets/react.svg'
import viteLogo from '/vite.svg'
import { ChakraProvider } from '@chakra-ui/react';
import ChatbotButton from './components/ChatbotButton';
import './App.css'
Expand Down
35 changes: 22 additions & 13 deletions src/components/ChatbotButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@ const ChatbotButton = () => {
return (
<Box position="fixed" bottom="4" right="4" zIndex="1000">
{!isOpen && (
<IconButton onClick={toggleChat} colorScheme="blue" borderRadius="full" p="4" icon={<ChatIcon />} />
<IconButton
onClick={toggleChat}
colorScheme="blue"
borderRadius="full"
p="4"
icon={<ChatIcon />}
/>
)}
{isOpen && (
<Box
Expand All @@ -41,26 +47,28 @@ const ChatbotButton = () => {
display="flex"
flexDirection="column"
>
<IconButton
icon={<CloseIcon />}
onClick={toggleChat}
colorScheme="red"
size="sm"
borderRadius="full"
width="1"
/>
<VStack spacing="4" flex="1" overflowY="auto">
<Box width="full" textAlign="right">
<IconButton
icon={<CloseIcon />}
onClick={toggleChat}
colorScheme="red"
size="sm"
borderRadius="full"
/>
</Box>
<Box width="full" textAlign="right"></Box>
{isInitialLoaded && (
<VStack spacing="2" align="stretch" flex="1">
{messages.map((message, index) => (
<HStack
key={index}
justifyContent={message.role === 'user' ? 'flex-end' : 'flex-start'}
justifyContent={
message.role === "user" ? "flex-end" : "flex-start"
}
>
<Box
bg={message.role === 'user' ? 'blue.500' : 'gray.300'}
color={message.role === 'user' ? 'white' : 'black'}
bg={message.role === "user" ? "blue.500" : "gray.300"}
color={message.role === "user" ? "white" : "black"}
px="4"
py="2"
borderRadius="md"
Expand All @@ -75,6 +83,7 @@ const ChatbotButton = () => {
<Box mt="4">
<InputGroup>
<Input
bg="gray.100"
value={inputValue}
onChange={handleInputChange}
placeholder="Type your message here..."
Expand Down