Check if error exists in Chat rather than ChatError

This commit is contained in:
James Blair 2026-05-08 20:34:18 +12:00
parent 08f45451bb
commit 59d2358845
Signed by: james
SSH key fingerprint: SHA256:hsDR3ENI2ZMgh+CNb+0PrFsj29DI007R+BMKUVGi6zQ
2 changed files with 2 additions and 4 deletions

View file

@ -1,9 +1,7 @@
import { AlertTriangleIcon } from "lucide-react"; import { AlertTriangleIcon } from "lucide-react";
import { Alert, AlertDescription, AlertTitle } from "../ui/alert"; import { Alert, AlertDescription, AlertTitle } from "../ui/alert";
export function ChatError({ error }: { error?: Error }) { export function ChatError({ error }: { error: Error }) {
if (!error) return null;
return ( return (
<Alert variant="destructive"> <Alert variant="destructive">
<AlertTriangleIcon /> <AlertTriangleIcon />

View file

@ -15,7 +15,7 @@ export function Chat() {
return ( return (
<div className="max-w-2xl flex flex-col gap-4"> <div className="max-w-2xl flex flex-col gap-4">
<ChatError error={error} /> {error && <ChatError error={error} />}
<ChatMessages messages={messages} /> <ChatMessages messages={messages} />
<ChatForm <ChatForm
onMessage={sendMessage} onMessage={sendMessage}