Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N4f2nya58RoRu4yEmJgRGE
18 lines
540 B
TypeScript
18 lines
540 B
TypeScript
"use client";
|
|
|
|
import { useEffect } from "react";
|
|
|
|
import { notifyError } from "@/lib/notify";
|
|
|
|
/**
|
|
* An error a flow keeps in state, said once as a toast whenever it changes to
|
|
* a new message (2026-09-30: no inline error bars). The message is the toast's
|
|
* id, so a remount repeats nothing on screen. Renders nothing.
|
|
*/
|
|
export function ErrorToast({ message }: Readonly<{ message: string | null | undefined }>) {
|
|
useEffect(() => {
|
|
if (message) notifyError(message, { id: `error:${message}` });
|
|
}, [message]);
|
|
return null;
|
|
}
|