Bin
2025-12-17 7c6dc86b52527ce8c7c7ed0aebe48d677972a5b1
1
2
3
4
5
6
7
8
9
10
11
import styles from "./ErrorMessage.module.scss";
import { sanitizeHtml } from "../../utils/html";
 
export const ErrorMessage = ({ error }) => {
  if (typeof error === "string") {
    return <div className={styles.error} dangerouslySetInnerHTML={{ __html: sanitizeHtml(error) }} />;
  }
  const body = error instanceof Error ? error.message : error;
 
  return <div className={styles.error}>{body}</div>;
};