import { useDomainflare } from "../context/DomainflareContext";

/** 底部 Toast */
export function ToastHost() {
  const { toastState } = useDomainflare();
  if (!toastState) return null;
  return (
    <div
      id="toast"
      className="toast"
      role="status"
      style={{ background: toastState.isError ? "var(--danger)" : "var(--ink)" }}
    >
      {toastState.text}
    </div>
  );
}
