@threatcaptain/tc-reports 0.2.16 → 0.2.18

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
@@ -52827,6 +52827,89 @@ const InsuranceHealthGauge = ({
52827
52827
  ) })
52828
52828
  ] });
52829
52829
  };
52830
+ const InsuranceImpactCards = ({
52831
+ score
52832
+ }) => {
52833
+ const getCardClasses = (score2) => {
52834
+ if (score2 >= 775) return "bg-green-50 border-green-200";
52835
+ if (score2 >= 700) return "bg-green-50 border-green-300";
52836
+ if (score2 >= 625) return "bg-blue-50 border-blue-200";
52837
+ if (score2 >= 550) return "bg-yellow-50 border-yellow-200";
52838
+ if (score2 >= 450) return "bg-orange-50 border-orange-200";
52839
+ return "bg-red-50 border-red-200";
52840
+ };
52841
+ const getIconClasses = (score2) => {
52842
+ if (score2 >= 775) return "text-green-600";
52843
+ if (score2 >= 700) return "text-green-600";
52844
+ if (score2 >= 625) return "text-blue-600";
52845
+ if (score2 >= 550) return "text-yellow-600";
52846
+ if (score2 >= 450) return "text-orange-600";
52847
+ return "text-red-600";
52848
+ };
52849
+ const getTextClasses = (score2) => {
52850
+ if (score2 >= 775) return "text-green-900";
52851
+ if (score2 >= 700) return "text-green-900";
52852
+ if (score2 >= 625) return "text-blue-900";
52853
+ if (score2 >= 550) return "text-yellow-900";
52854
+ if (score2 >= 450) return "text-orange-900";
52855
+ return "text-red-900";
52856
+ };
52857
+ const getDescriptionClasses = (score2) => {
52858
+ if (score2 >= 775) return "text-green-700";
52859
+ if (score2 >= 700) return "text-green-700";
52860
+ if (score2 >= 625) return "text-blue-700";
52861
+ if (score2 >= 550) return "text-yellow-700";
52862
+ if (score2 >= 450) return "text-orange-700";
52863
+ return "text-red-700";
52864
+ };
52865
+ const getCoverageText = (score2) => {
52866
+ if (score2 >= 775) return "Premium coverage with enhanced terms";
52867
+ if (score2 >= 700) return "Comprehensive coverage options available";
52868
+ if (score2 >= 625) return "Good coverage with standard terms";
52869
+ if (score2 >= 550) return "Limited coverage options";
52870
+ if (score2 >= 450) return "Restricted coverage with exclusions";
52871
+ return "Minimal coverage, high exclusions";
52872
+ };
52873
+ const getPremiumText = (score2) => {
52874
+ if (score2 >= 775) return "Preferred rates with significant discounts";
52875
+ if (score2 >= 700) return "Competitive rates, potential discounts";
52876
+ if (score2 >= 625) return "Standard market rates";
52877
+ if (score2 >= 550) return "Above-average premiums";
52878
+ if (score2 >= 450) return "High premiums with surcharges";
52879
+ return "Very high premiums, difficult to place";
52880
+ };
52881
+ const getUnderwritingText = (score2) => {
52882
+ if (score2 >= 775) return "Fast-track approval, minimal documentation";
52883
+ if (score2 >= 700) return "Streamlined approval process";
52884
+ if (score2 >= 625) return "Standard review and approval";
52885
+ if (score2 >= 550) return "Extended review process";
52886
+ if (score2 >= 450) return "Detailed review, additional requirements";
52887
+ return "Extensive review, may require risk mitigation plan";
52888
+ };
52889
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-4", children: [
52890
+ /* @__PURE__ */ jsxRuntime.jsx(Card, { className: getCardClasses(score), children: /* @__PURE__ */ jsxRuntime.jsx(CardContent, { className: "pt-4", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start space-x-3", children: [
52891
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Shield, { className: `h-5 w-5 mt-0.5 ${getIconClasses(score)}` }),
52892
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
52893
+ /* @__PURE__ */ jsxRuntime.jsx("h4", { className: `font-medium ${getTextClasses(score)}`, children: "Coverage Availability" }),
52894
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: `text-sm mt-1 ${getDescriptionClasses(score)}`, children: getCoverageText(score) })
52895
+ ] })
52896
+ ] }) }) }),
52897
+ /* @__PURE__ */ jsxRuntime.jsx(Card, { className: getCardClasses(score), children: /* @__PURE__ */ jsxRuntime.jsx(CardContent, { className: "pt-4", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start space-x-3", children: [
52898
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.TrendingUp, { className: `h-5 w-5 mt-0.5 ${getIconClasses(score)}` }),
52899
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
52900
+ /* @__PURE__ */ jsxRuntime.jsx("h4", { className: `font-medium ${getTextClasses(score)}`, children: "Premium Impact" }),
52901
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: `text-sm mt-1 ${getDescriptionClasses(score)}`, children: getPremiumText(score) })
52902
+ ] })
52903
+ ] }) }) }),
52904
+ /* @__PURE__ */ jsxRuntime.jsx(Card, { className: getCardClasses(score), children: /* @__PURE__ */ jsxRuntime.jsx(CardContent, { className: "pt-4", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start space-x-3", children: [
52905
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.FileText, { className: `h-5 w-5 mt-0.5 ${getIconClasses(score)}` }),
52906
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
52907
+ /* @__PURE__ */ jsxRuntime.jsx("h4", { className: `font-medium ${getTextClasses(score)}`, children: "Underwriting Process" }),
52908
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: `text-sm mt-1 ${getDescriptionClasses(score)}`, children: getUnderwritingText(score) })
52909
+ ] })
52910
+ ] }) }) })
52911
+ ] });
52912
+ };
52830
52913
  const InsuranceHealthScore = ({ reportData }) => {
52831
52914
  const { insuranceHealthData } = reportData;
52832
52915
  const score = insuranceHealthData.score || 650;
@@ -52902,13 +52985,11 @@ const InsuranceHealthScore = ({ reportData }) => {
52902
52985
  ] })
52903
52986
  ] }),
52904
52987
  /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "report-page space-y-6 border-t border-slate-200 pt-8", children: [
52905
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
52906
- /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-2xl font-bold text-slate-900 mb-2", children: "Your Insurance Health Score Results" }),
52907
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-slate-600", children: "Assessment results and category breakdown" })
52908
- ] }),
52909
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-6 gap-8", children: [
52910
- /* @__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 }) }),
52911
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "md:col-span-3 space-y-4", children: [
52988
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-2xl font-bold text-slate-900 mb-2", children: "Your Insurance Health Score Results" }),
52989
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-slate-600", children: "Assessment results and category breakdown" }),
52990
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-8", children: [
52991
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col items-center space-y-4", children: /* @__PURE__ */ jsxRuntime.jsx(InsuranceHealthGauge, { score, size: 320 }) }),
52992
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
52912
52993
  /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "font-semibold text-slate-900", children: "Security Category Scores" }),
52913
52994
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-3", children: (() => {
52914
52995
  if (insuranceHealthData.responses) {
@@ -52917,13 +52998,24 @@ const InsuranceHealthScore = ({ reportData }) => {
52917
52998
  );
52918
52999
  return domains.map((domain, index2) => {
52919
53000
  let statusClass = "";
53001
+ let statusLabel = "";
52920
53002
  const percentage = domain.percentage || 0;
52921
- if (percentage === 0) {
52922
- statusClass = "bg-red-500";
52923
- } else if (percentage === 100) {
52924
- statusClass = "bg-green-500";
52925
- } else {
52926
- statusClass = "bg-yellow-600";
53003
+ switch (true) {
53004
+ case percentage >= 80:
53005
+ statusClass = "bg-green-500";
53006
+ statusLabel = "PASS";
53007
+ break;
53008
+ case percentage >= 60:
53009
+ statusClass = "bg-yellow-500";
53010
+ statusLabel = "NEEDS IMPROVEMENT";
53011
+ break;
53012
+ case (percentage < 60 && percentage > 0):
53013
+ statusClass = "bg-red-500";
53014
+ statusLabel = "FAIL";
53015
+ break;
53016
+ default:
53017
+ statusClass = "bg-gray-400";
53018
+ statusLabel = "MISSING";
52927
53019
  }
52928
53020
  return /* @__PURE__ */ jsxRuntime.jsxs(
52929
53021
  "div",
@@ -52932,11 +53024,7 @@ const InsuranceHealthScore = ({ reportData }) => {
52932
53024
  children: [
52933
53025
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between mb-1 text-sm", children: [
52934
53026
  /* @__PURE__ */ jsxRuntime.jsx("h5", { className: "font-medium text-slate-900", children: domain.name }),
52935
- /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-xs text-gray-400", children: [
52936
- domain.score,
52937
- "/",
52938
- domain.maxScore
52939
- ] })
53027
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-gray-400", children: statusLabel })
52940
53028
  ] }),
52941
53029
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full bg-gray-200 rounded-full h-3", children: /* @__PURE__ */ jsxRuntime.jsx(
52942
53030
  "div",
@@ -52955,7 +53043,8 @@ const InsuranceHealthScore = ({ reportData }) => {
52955
53043
  }
52956
53044
  })() })
52957
53045
  ] })
52958
- ] })
53046
+ ] }),
53047
+ /* @__PURE__ */ jsxRuntime.jsx(InsuranceImpactCards, { score })
52959
53048
  ] }),
52960
53049
  /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "report-page space-y-6 border-t border-slate-200 pt-8", children: [
52961
53050
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center space-x-3", children: [