'use strict';

var React = require('react');
var index$1 = require('./index-5488badc.js');
var index = require('./index-ba659c28.js');
var CircleCheckButton = require('./CircleCheckButton-f76e5b5d.js');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var React__default = /*#__PURE__*/_interopDefaultLegacy(React);

const GenericCard = ({
  title = "Title Lorem Ipsum",
  thumbImgSrc,
  customThumbClass = "",
  customHeaderClass = "",
  type = index$1.WalletCategoryTypes.achievements,
  className,
  onClick = () => {
  },
  showChecked,
  checkStatus,
  flipped
}) => {
  const thumbClass = index.TYPE_TO_WALLET_DARK_COLOR[type] ? `bg-${index.TYPE_TO_WALLET_DARK_COLOR[type]}` : "bg-grayscale-50";
  const defaultThumbClass = `flex h-[110px] m-auto ${thumbClass} w-[140px] overflow-hidden flex-col justify-center items-center w-full rounded-[20px] ${customThumbClass}`;
  const imgSrc = (thumbImgSrc == null ? void 0 : thumbImgSrc.trim()) !== "" ? thumbImgSrc : index.TYPE_TO_IMG_SRC[type];
  const headerBgColor = index.TYPE_TO_WALLET_DARK_COLOR[type] ? `bg-${index.TYPE_TO_WALLET_DARK_COLOR[type]}` : "bg-grayscale-900";
  const checkBtnClass = checkStatus ? "generic-vc-card checked" : "generic-vc-card unchecked";
  const defaultHeaderClass = `flex generic-card-title w-full flex justify-center items-center  h-[76px] ${headerBgColor} ${customHeaderClass}`;
  const flippedClass = flipped ? "flex-col-reverse" : "flex-col";
  return /* @__PURE__ */ React__default["default"].createElement(
    "div",
    {
      onClick,
      className: `flex generic-display-card-simple bg-white ${flippedClass} shadow-[0_0_8px_0px_rgba(0,0,0,0.2)] relative $ py-[0px] px-[0px] w-[160px] h-[215px] rounded-[20px] overflow-hidden ${className}`
    },
    /* @__PURE__ */ React__default["default"].createElement("section", { className: defaultHeaderClass }, /* @__PURE__ */ React__default["default"].createElement("p", { className: "relative z-[100] text-[14px] px-[10px] py-[0px] font-bold mt-[10px] text-center text-white line-clamp-2" }, title)),
    /* @__PURE__ */ React__default["default"].createElement("section", { className: defaultThumbClass }, thumbImgSrc && (thumbImgSrc == null ? void 0 : thumbImgSrc.trim()) !== "" && /* @__PURE__ */ React__default["default"].createElement(
      "img",
      {
        className: "generic-display-card-img h-full w-full  w-[140px] h-[119px] rounded-[20px] object-cover overflow-hidden",
        src: thumbImgSrc != null ? thumbImgSrc : "",
        alt: "Credential Achievement Image"
      }
    ), (!thumbImgSrc || (thumbImgSrc == null ? void 0 : thumbImgSrc.trim()) === "") && /* @__PURE__ */ React__default["default"].createElement(
      "img",
      {
        className: "max-w-[130px] w-full h-full p-[10px] object-contain",
        src: imgSrc
      }
    )),
    /* @__PURE__ */ React__default["default"].createElement("section", { className: "generic-card-footer" }),
    showChecked && /* @__PURE__ */ React__default["default"].createElement("div", { className: "check-btn-overlay absolute top-[5px] left-[5px]" }, /* @__PURE__ */ React__default["default"].createElement(
      CircleCheckButton.CircleCheckButton,
      {
        checked: checkStatus,
        onClick,
        className: checkBtnClass
      }
    ))
  );
};

exports.GenericCard = GenericCard;
//# sourceMappingURL=GenericCard-2b20ab4b.js.map
