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