Skip to content

Commit

Permalink
add div
Browse files Browse the repository at this point in the history
  • Loading branch information
sainthiago committed Feb 29, 2024
1 parent a756631 commit 763dc39
Showing 1 changed file with 27 additions and 36 deletions.
63 changes: 27 additions & 36 deletions ai-chat/src/components/chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,47 +39,38 @@ const Chat = () => {
<div className="w-full h-full overflow-y-auto chat-border pb-[60px]">
<div className="flex flex-col gap-2 p-2 mt-[30px]">
{messages.length > 0 ? (
messages.map(
(
message,
index
) => {
return (
<div
key={index}
className="chat-card-bg chat-card chat-scale shadow overflow-hidden rounded-md p-3"
>
<div className="text-sm font-medium user-label">
{message.role === "user"
? activeAccountId
: message.role}
</div>
<div className="text-sm text-white">
<Markdown children={message.content} />
</div>
messages.map((message, index) => {
return (
<div
key={index}
className="chat-card-bg chat-card chat-scale shadow overflow-hidden rounded-md p-3"
>
<div className="text-sm font-medium user-label">
{message.role === "user" ? activeAccountId : message.role}
</div>
<div className="text-sm text-white">
<Markdown children={message.content} />
</div>
);
}
)
</div>
);
})
) : (
<div className="text-white w-full default-message text-center justify-center">
{" "}
<div className="block text-center">
{defaultMessage}
{!isConnected && (

<Button
className="white-button mt-4"
onClick={() => {
connect();
}}
>
{" "}
Connect
</Button>

)}
</div>
<div>{defaultMessage}</div>
{!isConnected && (
<Button
className="white-button mt-4"
onClick={() => {
connect();
}}
>
{" "}
Connect
</Button>
)}
</div>
</div>
)}
</div>
Expand Down

0 comments on commit 763dc39

Please sign in to comment.