All files / react-app/src/features/welcome cms.tsx

100% Statements 5/5
66.66% Branches 2/3
100% Functions 2/2
100% Lines 5/5

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132            2x 4x                                                                                                                                                                                                                                       2x 1x 1x            
import { LatestUpdates } from "@/components/Banner/latestUpdates";
import { Welcome } from "@/features/welcome/default";
import { useFeatureFlag } from "@/hooks/useFeatureFlag";
 
import { BrowseDash, PackageSearch } from "./packageSearch";
 
export const CMSWelcome = () => {
  const cards = [
    {
      id: 1,
      title: "MACPro System",
      content: "Medicaid & CHIP Program System",
      body: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
      buttonText: "Go to MACPro",
      buttonLink: "https://macpro.cms.gov/suite",
    },
    {
      id: 2,
      title: "SEA Tool",
      content: "State Early Alert Tool",
      body: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
      buttonText: "Go to SEA Tool",
      buttonLink: "https://sea.cms.gov/",
    },
    {
      id: 3,
      title: "WMS",
      content: "Waiver Management System",
      body: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
      buttonText: "Go to WMS",
      buttonLink: "https://wms-mmdl.cms.gov/WMS/faces/portal.jsp",
    },
    {
      id: 4,
      title: "eRegs",
      content: "Medicaid and CHIP eRegulations",
      body: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
      buttonText: "Go to eRegs",
      buttonLink: "https://eregulations.cms.gov/",
    },
    {
      id: 5,
      title: "Laserfiche",
      content: "Subtitle for Laserfiche",
      body: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
      buttonText: "Go to Laserfiche",
      buttonLink: "https://cmsrio.cms.local/laserfiche",
    },
    {
      id: 6,
      title: "MMDL",
      content: "Medicaid Model Data Lab",
      body: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
      buttonText: "Go to MMDL",
      buttonLink: "https://wms-mmdl.cms.gov/MMDL/faces/portal.jsp",
    },
  ];
 
  const renderCard = (card: (typeof cards)[number]) => (
    <div className="w-full md:w-[616px]">
      <div
        key={card.id}
        className="min-h-[229px] border rounded-[3px] bg-white flex flex-col justify-between"
      >
        <div className="pl-[24px] pr-4 pt-4">
          <h3 className="font-bold text-lg mb-[16px]">{card.title}</h3>
          <p className="font-semibold text-sm text-gray-800 mb-[16px]">{card.content}</p>
          <p className="text-sm text-gray-600">{card.body}</p>
        </div>
        <div className="pl-[24px] mt-[16px] mb-[24px]">
          <a
            href={card.buttonLink}
            target="_blank"
            rel="noopener noreferrer"
            className="inline-block font-bold border-2 border-[#0071BC] text-[#0071BC] px-4 py-2 rounded hover:bg-[#0071BC] hover:text-white transition-colors duration-200"
          >
            {card.buttonText}
          </a>
        </div>
      </div>
    </div>
  );
 
  return (
    <div className="w-full max-w-[1440px] mx-auto pt-[80px] px-[24px] xl:px-[102px]">
      <div className="flex flex-row justify-center gap-2">
        {/* Search section */}
        <PackageSearch />
        <div className="flex flex-col items-center w-full mb-8">
          <div className="h-[115px] border border-[#DFE1E2]" />
          <span className="my-2 text-sm text-[#9CA3AF]">or</span>
          <div className="h-[115px] border border-[#DFE1E2]" />
        </div>
        <BrowseDash />
      </div>
 
      {/* Latest Updates Banner */}
      <div className="mt-[56px] mx-auto w-full h-auto min-h-[228px] border-[2px] border-gray-300 rounded-[3px] bg-gray-100 px-[24px] py-[24px] flex flex-col gap-[16px]">
        <LatestUpdates />
      </div>
 
      {/* Access Header */}
      <div className="pt-[56px] pb-[25px] pl-[24px]">
        <h2 className="text-2xl font-[Merriweather] font-black">
          Access more SPA and waiver systems
        </h2>
      </div>
 
      {/* Cards Section */}
      <div className="w-full h-auto py-[8px] pr-[143px] pb-[87px]">
        <div className="flex flex-col gap-y-[40px]">
          {[0, 2, 4].map((i) => (
            <div key={i} className="flex flex-col md:flex-row gap-[40px]">
              {renderCard(cards[i])}
              {cards[i + 1] && renderCard(cards[i + 1])}
            </div>
          ))}
        </div>
      </div>
    </div>
  );
};
 
const CMSWelcomeWrapper = () => {
  const isCmsHomepageEnabled = useFeatureFlag("CMS_HOMEPAGE_FLAG");
  console.log({ isCmsHomepageEnabled });
 
  return <>{isCmsHomepageEnabled ? <CMSWelcome /> : <Welcome />}</>;
};
 
export default CMSWelcomeWrapper;