Skip to content

Commit 8eefb03

Browse files
authored
Merge pull request #1483 from swizzmagik/feat-improve-chat-formatting-line-breaks
feat: improve chat formatting line breaks
2 parents b3dcc51 + 86c87a5 commit 8eefb03

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

client/src/Chat.tsx

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { useState } from "react";
22
import { useParams } from "react-router-dom";
33
import { useMutation } from "@tanstack/react-query";
4-
import { Input } from "@/components/ui/input";
54
import { Button } from "@/components/ui/button";
5+
import { Input } from "@/components/ui/input";
66
import "./App.css";
77

88
type TextResponse = {
@@ -58,7 +58,7 @@ export default function Chat() {
5858
messages.map((message, index) => (
5959
<div
6060
key={index}
61-
className={`flex ${
61+
className={`text-left flex ${
6262
message.user === "user"
6363
? "justify-end"
6464
: "justify-start"
@@ -71,7 +71,9 @@ export default function Chat() {
7171
: "bg-muted"
7272
}`}
7373
>
74-
{message.text}
74+
<pre className="whitespace-pre-wrap break-words font-sans m-0">
75+
{message.text}
76+
</pre>
7577
</div>
7678
</div>
7779
))

0 commit comments

Comments
 (0)