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

feat: improve chat formatting line breaks #1483

Merged
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
Loading