import React from 'react';
import { P as PuzzlePiece } from './PuzzlePiece-1fb12c2e.js';
import { g as getTotalCountOfSkills, c as categorizeSkills } from './credential.helpers-2169f82b.js';

const CertDisplayCardSkillsCount = ({ skills, onClick, className, isInSkillsModal }) => {
  const skillsCount = getTotalCountOfSkills(skills);
  if (skillsCount === 0)
    return /* @__PURE__ */ React.createElement(React.Fragment, null);
  const skillsMap = categorizeSkills(skills);
  const totalSkills = Object.values(skillsMap).reduce(
    (total2, category) => total2 + (category == null ? void 0 : category.length),
    0
  );
  const totalSubskills = Object.values(skillsMap).reduce(
    (total2, category) => total2 + ((category == null ? void 0 : category.totalSubskillsCount) || 0),
    0
  );
  const total = totalSkills + totalSubskills;
  const text = skillsCount === 1 ? "Skill" : "Skills";
  return /* @__PURE__ */ React.createElement("div", {
    className: `flex items-center justify-center cursor-pointer bg-white rounded-[20px] ${className === "boost-generic" ? "" : "px-4 py-2 mt-8 shadow-bottom"} `,
    onClick
  }, /* @__PURE__ */ React.createElement("div", {
    className: `text-violet-500 flex items-center justify-center tracking-[0.75px] font-poppins font-semibold ${className === "boost-generic" ? "text-[12px] mt-[5px]" : "text-xl"}`
  }, isInSkillsModal ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", {
    className: "bg-violet-500 rounded-full flex items-center justify-center mr-[5px] p-1 h-[20px] w-[20px]"
  }, /* @__PURE__ */ React.createElement(PuzzlePiece, {
    className: "text-white",
    fill: "#fff"
  })), "+", total, " ", text) : /* @__PURE__ */ React.createElement(React.Fragment, null, "+", total, " ", text, /* @__PURE__ */ React.createElement("div", {
    className: "bg-violet-500 rounded-full flex items-center justify-center ml-2 p-1 h-[30px] w-[30px]"
  }, /* @__PURE__ */ React.createElement(PuzzlePiece, {
    className: "text-white",
    fill: "#fff"
  })))));
};

export { CertDisplayCardSkillsCount as C };
//# sourceMappingURL=CertDisplayCardSkillsCount-189f5f34.js.map
