90 lines
3.6 KiB
TypeScript
90 lines
3.6 KiB
TypeScript
// Copyright (c) 2026 Probo Inc <hello@getprobo.com>.
|
|
//
|
|
// Permission to use, copy, modify, and/or distribute this software for any
|
|
// purpose with or without fee is hereby granted, provided that the above
|
|
// copyright notice and this permission notice appear in all copies.
|
|
//
|
|
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
// PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
import { lazy } from "@probo/react-lazy";
|
|
import type { AppRoute } from "@probo/routes";
|
|
import { Fragment } from "react";
|
|
import { redirect } from "react-router";
|
|
|
|
import { LinkCardSkeleton } from "#/components/skeletons/LinkCardSkeleton";
|
|
import { PageSkeleton } from "#/components/skeletons/PageSkeleton";
|
|
|
|
export const cookieBannerRoutes = [
|
|
{
|
|
path: "cookie-banners",
|
|
Fallback: PageSkeleton,
|
|
Component: lazy(() => import("#/pages/organizations/cookie-banners/overview/CookieBannersOverviewPageLoader")),
|
|
},
|
|
{
|
|
path: "cookie-banners/new",
|
|
Fallback: PageSkeleton,
|
|
Component: lazy(() => import("#/pages/organizations/cookie-banners/NewCookieBannerPage")),
|
|
},
|
|
{
|
|
path: "cookie-banners/:cookieBannerId",
|
|
Fallback: PageSkeleton,
|
|
Component: lazy(() => import("#/pages/organizations/cookie-banners/configuration/CookieBannerConfigLayoutLoader")),
|
|
children: [
|
|
{
|
|
path: "",
|
|
loader: () => {
|
|
// eslint-disable-next-line @typescript-eslint/only-throw-error
|
|
throw redirect("settings");
|
|
},
|
|
Component: Fragment,
|
|
},
|
|
{
|
|
path: "settings",
|
|
Fallback: LinkCardSkeleton,
|
|
Component: lazy(() => import("#/pages/organizations/cookie-banners/configuration/settings/CookieBannerSettingsPageLoader")),
|
|
},
|
|
{
|
|
path: "translations",
|
|
Fallback: LinkCardSkeleton,
|
|
Component: lazy(() => import("#/pages/organizations/cookie-banners/configuration/translations/CookieBannerTranslationsPageLoader")),
|
|
},
|
|
{
|
|
path: "display",
|
|
Fallback: LinkCardSkeleton,
|
|
Component: lazy(() => import("#/pages/organizations/cookie-banners/configuration/display/CookieBannerDisplayPageLoader")),
|
|
},
|
|
{
|
|
path: "consent-records",
|
|
Fallback: LinkCardSkeleton,
|
|
Component: lazy(() => import("#/pages/organizations/cookie-banners/configuration/consent-records/CookieBannerConsentRecordsPageLoader")),
|
|
},
|
|
{
|
|
path: "trackers",
|
|
Fallback: LinkCardSkeleton,
|
|
Component: lazy(() => import("#/pages/organizations/cookie-banners/configuration/trackers/CookieBannerTrackersPageLoader")),
|
|
},
|
|
{
|
|
path: "resources",
|
|
Fallback: LinkCardSkeleton,
|
|
Component: lazy(() => import("#/pages/organizations/cookie-banners/configuration/resources/CookieBannerResourcesPageLoader")),
|
|
},
|
|
],
|
|
},
|
|
{
|
|
path: "cookie-banners/:cookieBannerId/consent-records/:consentRecordId",
|
|
Fallback: PageSkeleton,
|
|
Component: lazy(() => import("#/pages/organizations/cookie-banners/configuration/consent-records/CookieBannerConsentRecordPageLoader")),
|
|
},
|
|
{
|
|
path: "cookie-banners/:cookieBannerId/trackers/:trackerPatternId",
|
|
Fallback: PageSkeleton,
|
|
Component: lazy(() => import("#/pages/organizations/cookie-banners/configuration/trackers/TrackerPatternDetailPageLoader")),
|
|
},
|
|
] satisfies AppRoute[];
|