All files / react-app/src router.tsx

75% Statements 3/4
100% Branches 0/0
0% Functions 0/1
75% Lines 3/4

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 133                  72x 72x                 72x                                                                                                                                                                                                                                  
import * as C from "@/components";
import { TimeoutModal } from "@/components";
import * as F from "@/features";
import {
  postSubmissionLoader,
  PostSubmissionWrapper,
} from "@/features/forms/post-submission/post-submission-forms";
import { QueryClient } from "@tanstack/react-query";
import { createBrowserRouter, Outlet } from "react-router";
export const queryClient = new QueryClient();
export const FAQ_TAB = "faq-tab";
 
const RoutesWithTimeout = () => (
  <>
    <TimeoutModal />
    <Outlet />
  </>
);
 
export const router = createBrowserRouter([
  {
    path: "/",
    element: <C.Layout />,
    children: [
      { path: "/", index: true, element: <F.Welcome /> },
      { path: "/faq", element: <F.Faq /> },
      { path: "/faq/:id", element: <F.Faq /> },
      { path: "/webforms", element: <F.WebformsList /> },
      { path: "/webform/:id/:version", element: <F.Webform /> },
      {
        element: <RoutesWithTimeout />,
        children: [
          {
            path: "/dashboard",
            element: <F.Dashboard />,
            loader: F.dashboardLoader(queryClient),
          },
          {
            path: "/details/:authority/:id",
            element: <F.Details />,
            loader: F.packageDetailsLoader,
          },
          {
            path: "/new-submission/spa/medicaid/create",
            element: <F.MedicaidForm />,
          },
          {
            path: "/new-submission/spa/chip/create",
            element: <F.ChipForm />,
          },
          {
            path: "/new-submission/waiver/b/capitated/amendment/create",
            element: <F.CapitatedWaivers.AmendmentForm />,
          },
          {
            path: "/new-submission/waiver/b/capitated/initial/create",
            element: <F.CapitatedWaivers.InitialForm />,
          },
          {
            path: "/new-submission/waiver/b/capitated/renewal/create",
            element: <F.CapitatedWaivers.Renewal />,
          },
          {
            path: "/new-submission/waiver/b/b4/renewal/create",
            element: <F.ContractingWaivers.RenewalForm />,
          },
          {
            path: "/new-submission/waiver/b/b4/initial/create",
            element: <F.ContractingWaivers.InitialForm />,
          },
          {
            path: "/new-submission/waiver/b/b4/amendment/create",
            element: <F.ContractingWaivers.AmendmentForm />,
          },
          {
            path: "/new-submission/waiver/app-k",
            element: <F.AppKAmendmentForm />,
          },
          {
            path: "/new-submission/waiver/temporary-extensions",
            element: <F.TemporaryExtensionForm />,
          },
          {
            path: "/new-submission",
            element: <F.NewSubmissionInitialOptions />,
          },
          {
            path: "/new-submission/spa",
            element: <F.SPASubmissionOptions />,
          },
          {
            path: "/new-submission/waiver",
            element: <F.WaiverSubmissionOptions />,
          },
          {
            path: "/new-submission/waiver/b",
            element: <F.BWaiverSubmissionOptions />,
          },
          {
            path: "/new-submission/waiver/b/b4",
            element: <F.B4WaiverSubmissionOptions />,
          },
          {
            path: "/new-submission/waiver/b/capitated",
            element: <F.BCapWaiverSubmissionOptions />,
          },
          {
            path: "/new-submission/spa/medicaid",
            element: <F.MedicaidSPASubmissionOptions />,
          },
          {
            path: "/new-submission/spa/chip",
            element: <F.ChipSPASubmissionOptions />,
          },
          {
            path: "/new-submission/spa/medicaid/landing/medicaid-eligibility",
            element: <F.MedicaidEligibilityLandingPage />,
          },
          { path: "/profile", element: <F.Profile /> },
          { path: "/guides/abp", element: <F.ABPGuide /> },
          {
            path: "/actions/:type/:authority/:id",
            element: <PostSubmissionWrapper />,
            loader: postSubmissionLoader,
          },
        ],
      },
    ],
    loader: F.loader(queryClient),
    HydrateFallback: () => null,
  },
]);