Bin
2025-12-17 6801eeed5d7e7b23484b3d64f755c5fb7ddccbc5
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>;
};