import React from 'react';

export interface ErrorMessageProps {
  error: string | string[];
  className?: string;
}

export function ErrorMessage({ error, className = '' }: ErrorMessageProps): JSX.Element {
  const errors = Array.isArray(error) ? error : [error];

  return (
    <div className={`notice notice-error ${className}`.trim()}>
      {errors.map((err, index) => (
        <p key={index}>{err}</p>
      ))}
    </div>
  );
}
