Skip to content

Commit

Permalink
Merge pull request #1483 from swizzmagik/feat-improve-chat-formatting…
Browse files Browse the repository at this point in the history
…-line-breaks

feat: improve chat formatting line breaks
  • Loading branch information
shakkernerd authored Dec 26, 2024
2 parents b3dcc51 + 86c87a5 commit 8eefb03
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions client/src/Chat.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useState } from "react";
import { useParams } from "react-router-dom";
import { useMutation } from "@tanstack/react-query";
import { Input } from "@/components/ui/input";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import "./App.css";

type TextResponse = {
Expand Down Expand Up @@ -58,7 +58,7 @@ export default function Chat() {
messages.map((message, index) => (
<div
key={index}
className={`flex ${
className={`text-left flex ${
message.user === "user"
? "justify-end"
: "justify-start"
Expand All @@ -71,7 +71,9 @@ export default function Chat() {
: "bg-muted"
}`}
>
{message.text}
<pre className="whitespace-pre-wrap break-words font-sans m-0">
{message.text}
</pre>
</div>
</div>
))
Expand Down

0 comments on commit 8eefb03

Please sign in to comment.