import React from 'react';
import Icon from '../../shared/components/icon';

type ErrorProps = {
  message?: string;
};
const Error: React.FC<ErrorProps> = ({ message }) => {
  return (
    <section className="error">
      <div className="error__container">
        <div className="error__card">
          <div className="error__icon">
            <Icon name="ui-triangle-error" width={20} height={20} />
          </div>
          <h1 className="error__title">Something went wrong</h1>
          <p className="error__message">{message || 'Sorry, something went wrong. Please try again later.'}</p>

          <a href="/" className="cta cta--primary error__link">
            Back to home
          </a>
        </div>
      </div>
    </section>
  );
};

export default Error;
