Bin
2025-12-16 9e0b2ba2c317b1a86212f24cbae3195ad1f3dbfa
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>;
};