type ReportCardProps = {
  reportImage?: string;
  reportTitle?: string;
  reportDate?: string;
  downloadLink?: string;
  downloadType?: 'upload' | 'link';
}

export default function ReportCard({
  reportImage = "images/img-report.png",
  reportTitle = "Title Elit ipsum Lorem irure incididunt elit aliquip duis. Dolor exercitation sunt consectetur non proident eu do irure magna aliqua fugiat.",
  reportDate = "26 Mar 2025",
  downloadLink = "/images/img-report.png",
  downloadType = 'upload',
}: ReportCardProps) {
  const isExternal = downloadType === 'link';

  return (
    <div className="reportCard">
      <figure className="reportCard-visual">
        <img
          className="object-scale-down object-center"
          src={reportImage}
          alt=""
        />
      </figure>
      <div className="reportCard-information">
        <h3 className="reportCard-title">
          {reportTitle}
        </h3>
        <p className="reportCard-date">
          <i className="icon-clander reportCard-dateIcon"></i>
          {reportDate}
        </p>
        <a
          href={downloadLink}
          className="button button--second reportCard-action"
          download={isExternal ? undefined : true}
          target={isExternal ? "_blank" : undefined}
          rel={isExternal ? "noreferrer" : undefined}
        >
          <span className="button-text">Download</span>
          <i className="icon-download"></i>
        </a>
      </div>
    </div>
  )

}
