Check if error exists in Chat rather than ChatError
This commit is contained in:
parent
08f45451bb
commit
59d2358845
2 changed files with 2 additions and 4 deletions
|
|
@ -1,9 +1,7 @@
|
|||
import { AlertTriangleIcon } from "lucide-react";
|
||||
import { Alert, AlertDescription, AlertTitle } from "../ui/alert";
|
||||
|
||||
export function ChatError({ error }: { error?: Error }) {
|
||||
if (!error) return null;
|
||||
|
||||
export function ChatError({ error }: { error: Error }) {
|
||||
return (
|
||||
<Alert variant="destructive">
|
||||
<AlertTriangleIcon />
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ export function Chat() {
|
|||
|
||||
return (
|
||||
<div className="max-w-2xl flex flex-col gap-4">
|
||||
<ChatError error={error} />
|
||||
{error && <ChatError error={error} />}
|
||||
<ChatMessages messages={messages} />
|
||||
<ChatForm
|
||||
onMessage={sendMessage}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue