@threatcaptain/tc-reports 0.2.17 → 0.2.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -52117,7 +52117,6 @@ const UnifiedCostBreakdownChart = ({
52117
52117
  ) }) });
52118
52118
  };
52119
52119
  const FinancialImpact = ({ reportData }) => {
52120
- var _a;
52121
52120
  const { clientData, simulationData } = reportData;
52122
52121
  const { industry } = clientData;
52123
52122
  const getIndustryRiskLevel = (industry2) => {
@@ -52328,6 +52327,7 @@ const FinancialImpact = ({ reportData }) => {
52328
52327
  };
52329
52328
  const riskLevel = getIndustryRiskLevel(industry);
52330
52329
  const dynamicCostBreakdown = createCostBreakdownFromSimulation(simulationData);
52330
+ const calculatedCost = simulationData.use_calculated_downtime === false ? simulationData.total_cost : simulationData.adjusted_total_cost;
52331
52331
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
52332
52332
  /* @__PURE__ */ jsxRuntime.jsx(
52333
52333
  "section",
@@ -52346,12 +52346,12 @@ const FinancialImpact = ({ reportData }) => {
52346
52346
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.DollarSign, { className: "w-8 h-8" }),
52347
52347
  /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-2xl font-bold", children: "TOTAL POTENTIAL IMPACT" })
52348
52348
  ] }),
52349
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-4xl font-bold", children: simulationData.use_calculated_downtime === false ? formatCurrency(simulationData.total_cost) : formatCurrency(simulationData.adjusted_total_cost) }),
52349
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-4xl font-bold", children: formatCurrency(calculatedCost) }),
52350
52350
  /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-sm opacity-75 mt-2", children: [
52351
- "Cost Range: ",
52352
- formatCurrency(simulationData.total_cost * 0.8),
52353
- " - ",
52354
- formatCurrency(simulationData.total_cost * 1.2)
52351
+ "Cost Range:  ",
52352
+ formatCurrency(calculatedCost * 0.8),
52353
+ " -  ",
52354
+ formatCurrency(calculatedCost * 1.2)
52355
52355
  ] })
52356
52356
  ] }),
52357
52357
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
@@ -52412,9 +52412,7 @@ const FinancialImpact = ({ reportData }) => {
52412
52412
  business_downtime: dynamicCostBreakdown.business_downtime,
52413
52413
  regulatory_fines: dynamicCostBreakdown.regulatory_fines,
52414
52414
  reputation_damage: dynamicCostBreakdown.reputation_damage,
52415
- totalCost: parseInt(
52416
- ((_a = clientData.totalEstimatedCost) == null ? void 0 : _a.replace(/,/g, "")) || "0"
52417
- ) || clientData.totalCost
52415
+ totalCost: calculatedCost
52418
52416
  }
52419
52417
  ) }) }),
52420
52418
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "lg:col-span-3 space-y-4", children: [
@@ -52985,13 +52983,11 @@ const InsuranceHealthScore = ({ reportData }) => {
52985
52983
  ] })
52986
52984
  ] }),
52987
52985
  /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "report-page space-y-6 border-t border-slate-200 pt-8", children: [
52988
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
52989
- /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-2xl font-bold text-slate-900 mb-2", children: "Your Insurance Health Score Results" }),
52990
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-slate-600", children: "Assessment results and category breakdown" })
52991
- ] }),
52992
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-6 gap-8", children: [
52993
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "md:col-span-3 flex flex-col items-center space-y-4", children: /* @__PURE__ */ jsxRuntime.jsx(InsuranceHealthGauge, { score, size: 320 }) }),
52994
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "md:col-span-3 space-y-4", children: [
52986
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-2xl font-bold text-slate-900 mb-2", children: "Your Insurance Health Score Results" }),
52987
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-slate-600", children: "Assessment results and category breakdown" }),
52988
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-8", children: [
52989
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col items-center space-y-4", children: /* @__PURE__ */ jsxRuntime.jsx(InsuranceHealthGauge, { score, size: 320 }) }),
52990
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
52995
52991
  /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "font-semibold text-slate-900", children: "Security Category Scores" }),
52996
52992
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-3", children: (() => {
52997
52993
  if (insuranceHealthData.responses) {
@@ -53000,13 +52996,24 @@ const InsuranceHealthScore = ({ reportData }) => {
53000
52996
  );
53001
52997
  return domains.map((domain, index2) => {
53002
52998
  let statusClass = "";
52999
+ let statusLabel = "";
53003
53000
  const percentage = domain.percentage || 0;
53004
- if (percentage === 0) {
53005
- statusClass = "bg-red-500";
53006
- } else if (percentage === 100) {
53007
- statusClass = "bg-green-500";
53008
- } else {
53009
- statusClass = "bg-yellow-600";
53001
+ switch (true) {
53002
+ case percentage >= 80:
53003
+ statusClass = "bg-green-500";
53004
+ statusLabel = "PASS";
53005
+ break;
53006
+ case percentage >= 60:
53007
+ statusClass = "bg-yellow-500";
53008
+ statusLabel = "FAIR";
53009
+ break;
53010
+ case (percentage < 60 && percentage > 0):
53011
+ statusClass = "bg-red-500";
53012
+ statusLabel = "FAIL";
53013
+ break;
53014
+ default:
53015
+ statusClass = "bg-gray-400";
53016
+ statusLabel = "MISSING";
53010
53017
  }
53011
53018
  return /* @__PURE__ */ jsxRuntime.jsxs(
53012
53019
  "div",
@@ -53015,11 +53022,7 @@ const InsuranceHealthScore = ({ reportData }) => {
53015
53022
  children: [
53016
53023
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between mb-1 text-sm", children: [
53017
53024
  /* @__PURE__ */ jsxRuntime.jsx("h5", { className: "font-medium text-slate-900", children: domain.name }),
53018
- /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-xs text-gray-400", children: [
53019
- domain.score,
53020
- "/",
53021
- domain.maxScore
53022
- ] })
53025
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-gray-400", children: statusLabel })
53023
53026
  ] }),
53024
53027
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full bg-gray-200 rounded-full h-3", children: /* @__PURE__ */ jsxRuntime.jsx(
53025
53028
  "div",