import { memo } from "react"; import cn from "@/helpers/cn"; import { H6 } from "./Typography"; interface ErrorMessageProps { className?: string; error?: { message?: string }; title?: string; } const ErrorMessage = ({ className = "", error, title }: ErrorMessageProps) => { if (!error) { return null; } return (
{title ?
{title}
: null}
{error?.message}
); }; export default memo(ErrorMessage);