@burdenoff/microfe-notification 2026.731.1 → 2026.801.1
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/AdminNotificationRoutes.js +1 -1
- package/dist/AdminNotificationRoutes.js.map +1 -1
- package/dist/NotificationRoutes.js +1 -1
- package/dist/NotificationRoutes.js.map +1 -1
- package/dist/UserNotificationRoutes.js +1 -1
- package/dist/UserNotificationRoutes.js.map +1 -1
- package/dist/pages/CreateNotificationPage.js +1 -1
- package/dist/pages/CreateNotificationPage.js.map +1 -1
- package/dist/pages/NotificationLandingPage.js +1 -1
- package/dist/pages/NotificationLandingPage.js.map +1 -1
- package/dist/pages/NotificationTemplatesPage.js +1 -1
- package/dist/pages/NotificationTemplatesPage.js.map +1 -1
- package/dist/pages/TemplateEditorPage.js +1 -1
- package/dist/pages/TemplateEditorPage.js.map +1 -1
- package/dist/providers/NotificationProvider.js +1 -1
- package/dist/providers/NotificationProvider.js.map +1 -1
- package/package.json +3 -3
|
@@ -7,7 +7,7 @@ import { Suspense as a, lazy as o, useEffect as s } from "react";
|
|
|
7
7
|
import { PermissionGate as c } from "@burdenoff/fe-libs/shared/components";
|
|
8
8
|
import { useFeatureFlagDetails as l } from "@burdenoff/fe-libs/shared/feature-flags";
|
|
9
9
|
import { useGlobalUi as u } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
10
|
-
import { Navigate as d, Route as f, Routes as p, useNavigate as m } from "react-router
|
|
10
|
+
import { Navigate as d, Route as f, Routes as p, useNavigate as m } from "react-router";
|
|
11
11
|
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
12
12
|
//#region src/AdminNotificationRoutes.tsx
|
|
13
13
|
var _ = o(() => import("./pages/NotificationHistoryAdminPage.js").then((e) => ({ default: e.NotificationHistoryAdminPage }))), v = o(() => import("./pages/NotificationTemplatesPage.js").then((e) => ({ default: e.NotificationTemplatesPage }))), y = o(() => import("./pages/TemplateEditorPage.js").then((e) => ({ default: e.TemplateEditorPage }))), b = o(() => import("./pages/CreateNotificationPage.js").then((e) => ({ default: e.CreateNotificationPage }))), x = o(() => import("./pages/NotificationTopicsPage.js").then((e) => ({ default: e.NotificationTopicsPage })));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdminNotificationRoutes.js","names":[],"sources":["../src/AdminNotificationRoutes.tsx"],"sourcesContent":["import { lazy, Suspense, useEffect, type ReactNode } from 'react';\nimport { Navigate, Route, Routes, useNavigate } from 'react-router
|
|
1
|
+
{"version":3,"file":"AdminNotificationRoutes.js","names":[],"sources":["../src/AdminNotificationRoutes.tsx"],"sourcesContent":["import { lazy, Suspense, useEffect, type ReactNode } from 'react';\nimport { Navigate, Route, Routes, useNavigate } from 'react-router';\nimport { useFeatureFlagDetails } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { PermissionGate } from '@burdenoff/fe-libs/shared/components';\nimport { useGlobalUi } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { FeatureDisabledPage } from './components/FeatureDisabledPage';\nimport { NOTIFICATION_PERMISSIONS, type NotificationPermission } from './constants/permissions';\nimport { useNotification } from './providers/NotificationProvider';\n\n// Eager load - Primary landing page\nimport { NotificationCenterPage } from './pages/NotificationCenterPage';\nimport { NotificationLandingPage } from './pages/NotificationLandingPage';\n\n// Lazy load - Secondary pages\nconst NotificationHistoryAdminPage = lazy(() =>\n import('./pages/NotificationHistoryAdminPage').then((m) => ({\n default: m.NotificationHistoryAdminPage,\n }))\n);\nconst NotificationTemplatesPage = lazy(() =>\n import('./pages/NotificationTemplatesPage').then((m) => ({\n default: m.NotificationTemplatesPage,\n }))\n);\nconst TemplateEditorPage = lazy(() =>\n import('./pages/TemplateEditorPage').then((m) => ({ default: m.TemplateEditorPage }))\n);\nconst CreateNotificationPage = lazy(() =>\n import('./pages/CreateNotificationPage').then((m) => ({ default: m.CreateNotificationPage }))\n);\nconst NotificationTopicsPage = lazy(() =>\n import('./pages/NotificationTopicsPage').then((m) => ({ default: m.NotificationTopicsPage }))\n);\n\n// Loading fallback component\nfunction PageLoader() {\n return (\n <div className=\"flex h-64 items-center justify-center\">\n <div className=\"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent\" />\n </div>\n );\n}\n\n// Pair toast + programmatic navigation in one effect to avoid <Navigate> unmounting before the toast fires.\n// Uses absolute `${basePath}/center` because relative `../center` resolves wrong from nested paths like `/templates/new`.\nfunction AccessDeniedRedirect() {\n const { showToast } = useGlobalUi();\n const navigate = useNavigate();\n const { basePath } = useNotification();\n useEffect(() => {\n showToast('You do not have permission to access that notification page.', 'warning');\n navigate(`${basePath}/center`, { replace: true });\n // Run once per access-denied mount; re-running on hook identity changes would duplicate the toast.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n return null;\n}\n\n// Discriminated union: callers must pass exactly one of `permission` / `permissions`.\ntype AdminRouteGateProps = {\n children: ReactNode;\n} & (\n | { permission: NotificationPermission; permissions?: never; requireAll?: never }\n | {\n permission?: never;\n permissions: NotificationPermission[];\n requireAll?: boolean;\n }\n);\n\nfunction AdminRouteGate(props: AdminRouteGateProps) {\n const { children, ...gateProps } = props;\n return (\n <PermissionGate\n permission={gateProps.permission}\n permissions={gateProps.permissions}\n requireAll={gateProps.requireAll}\n loading={<PageLoader />}\n fallback={<AccessDeniedRedirect />}\n >\n {children}\n </PermissionGate>\n );\n}\n\n// Admin-app router for the notification MFE. Admin routes are wrapped in PermissionGate.\nexport function AdminNotificationRoutes() {\n // Explicit `false` fallback prevents provider's default-allow from leaking unseeded flags.\n const templatesDetails = useFeatureFlagDetails('notification.templates');\n const createDetails = useFeatureFlagDetails('notification.create');\n const historyDetails = useFeatureFlagDetails('notification.history');\n const templatesEnabled = templatesDetails ? Boolean(templatesDetails.value) : false;\n const createEnabled = createDetails ? Boolean(createDetails.value) : false;\n const historyEnabled = historyDetails ? Boolean(historyDetails.value) : false;\n\n return (\n <Suspense fallback={<PageLoader />}>\n <Routes>\n {/* Tabbed landing - default route */}\n <Route index element={<NotificationLandingPage />} />\n\n {/* User-facing routes (all users) */}\n <Route path=\"center\" element={<NotificationCenterPage />} />\n <Route\n path=\"history\"\n element={\n historyEnabled ? (\n <NotificationHistoryAdminPage />\n ) : (\n <FeatureDisabledPage\n title=\"Notification history is not enabled\"\n description=\"This admin page is controlled by the notification.history feature flag. Enable the flag before validating delivery history.\"\n />\n )\n }\n />\n\n {/* Gate admits any actor with read or any write permission; page disables write actions for read-only. */}\n {templatesEnabled && (\n <Route\n path=\"templates\"\n element={\n <AdminRouteGate\n permissions={[\n NOTIFICATION_PERMISSIONS.TEMPLATE_LIST,\n NOTIFICATION_PERMISSIONS.TEMPLATE_CREATE,\n NOTIFICATION_PERMISSIONS.TEMPLATE_UPDATE,\n NOTIFICATION_PERMISSIONS.TEMPLATE_DELETE,\n ]}\n >\n <NotificationTemplatesPage />\n </AdminRouteGate>\n }\n />\n )}\n {templatesEnabled && (\n <Route\n path=\"templates/new\"\n element={\n <AdminRouteGate permission={NOTIFICATION_PERMISSIONS.TEMPLATE_CREATE}>\n <TemplateEditorPage />\n </AdminRouteGate>\n }\n />\n )}\n {templatesEnabled && (\n <Route\n path=\"templates/:templateId\"\n element={\n <AdminRouteGate permission={NOTIFICATION_PERMISSIONS.TEMPLATE_UPDATE}>\n <TemplateEditorPage />\n </AdminRouteGate>\n }\n />\n )}\n\n {/* Admin routes - Create/Send Notification (wrapped in PermissionGate) */}\n {createEnabled && (\n <Route\n path=\"create\"\n element={\n <AdminRouteGate\n permissions={[\n NOTIFICATION_PERMISSIONS.NOTIFICATION_CREATE,\n NOTIFICATION_PERMISSIONS.NOTIFICATION_SEND,\n ]}\n requireAll\n >\n <CreateNotificationPage />\n </AdminRouteGate>\n }\n />\n )}\n {/* Topics CRUD maps to `notification:create` per backend @rbac — tracked in BOFF-2386. */}\n {createEnabled && (\n <Route\n path=\"topics\"\n element={\n <AdminRouteGate permission={NOTIFICATION_PERMISSIONS.NOTIFICATION_CREATE}>\n <NotificationTopicsPage />\n </AdminRouteGate>\n }\n />\n )}\n\n {/* Catch-all route - redirect to index using path-relative navigation */}\n <Route path=\"*\" element={<Navigate to=\"..\" replace relative=\"path\" />} />\n </Routes>\n </Suspense>\n );\n}\n"],"mappings":"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"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { NotificationCenterPage as e } from "./pages/NotificationCenterPage.js";
|
|
2
2
|
import { NotificationLandingPage as t } from "./pages/NotificationLandingPage.js";
|
|
3
3
|
import { Suspense as n, lazy as r } from "react";
|
|
4
|
-
import { Navigate as i, Route as a, Routes as o } from "react-router
|
|
4
|
+
import { Navigate as i, Route as a, Routes as o } from "react-router";
|
|
5
5
|
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
6
6
|
//#region src/NotificationRoutes.tsx
|
|
7
7
|
var l = r(() => import("./pages/NotificationHistoryPage.js").then((e) => ({ default: e.NotificationHistoryPage }))), u = r(() => import("./pages/NotificationTemplatesPage.js").then((e) => ({ default: e.NotificationTemplatesPage }))), d = r(() => import("./pages/TemplateEditorPage.js").then((e) => ({ default: e.TemplateEditorPage }))), f = r(() => import("./pages/CreateNotificationPage.js").then((e) => ({ default: e.CreateNotificationPage }))), p = r(() => import("./pages/NotificationTopicsPage.js").then((e) => ({ default: e.NotificationTopicsPage }))), m = r(() => import("./pages/NotificationPreferencesPage.js").then((e) => ({ default: e.NotificationPreferencesPage })));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationRoutes.js","names":[],"sources":["../src/NotificationRoutes.tsx"],"sourcesContent":["import { lazy, Suspense } from 'react';\nimport { Navigate, Route, Routes } from 'react-router
|
|
1
|
+
{"version":3,"file":"NotificationRoutes.js","names":[],"sources":["../src/NotificationRoutes.tsx"],"sourcesContent":["import { lazy, Suspense } from 'react';\nimport { Navigate, Route, Routes } from 'react-router';\n\n// Eager load - Primary landing page\nimport { NotificationCenterPage } from './pages/NotificationCenterPage';\nimport { NotificationLandingPage } from './pages/NotificationLandingPage';\n\n// Lazy load - Secondary pages\nconst NotificationHistoryPage = lazy(() =>\n import('./pages/NotificationHistoryPage').then((m) => ({\n default: m.NotificationHistoryPage,\n }))\n);\nconst NotificationTemplatesPage = lazy(() =>\n import('./pages/NotificationTemplatesPage').then((m) => ({\n default: m.NotificationTemplatesPage,\n }))\n);\nconst TemplateEditorPage = lazy(() =>\n import('./pages/TemplateEditorPage').then((m) => ({ default: m.TemplateEditorPage }))\n);\nconst CreateNotificationPage = lazy(() =>\n import('./pages/CreateNotificationPage').then((m) => ({ default: m.CreateNotificationPage }))\n);\nconst NotificationTopicsPage = lazy(() =>\n import('./pages/NotificationTopicsPage').then((m) => ({ default: m.NotificationTopicsPage }))\n);\nconst NotificationPreferencesPage = lazy(() =>\n import('./pages/NotificationPreferencesPage').then((m) => ({\n default: m.NotificationPreferencesPage,\n }))\n);\n\n// Loading fallback component\nfunction PageLoader() {\n return (\n <div className=\"flex h-64 items-center justify-center\">\n <div className=\"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent\" />\n </div>\n );\n}\n\n/**\n * Internal router for the Notification microfrontend.\n * This component handles routing within the microfrontend using React Router v7.\n *\n * Routes:\n * - / → Redirect to notification center\n * - /center → Notification center (in-app notifications)\n * - /history → Notification history and archive\n * - /templates → Notification templates list (admin)\n * - /templates/new → Create new template (admin)\n * - /templates/:templateId → Edit template (admin)\n * - /create → Create and send notification (admin)\n * - /topics → Manage topics (admin)\n * - /preferences → User topic preferences\n */\nexport function NotificationRoutes() {\n return (\n <Suspense fallback={<PageLoader />}>\n <Routes>\n {/* Tabbed landing - default route */}\n <Route index element={<NotificationLandingPage />} />\n\n {/* User-facing routes (all users) */}\n <Route path=\"center\" element={<NotificationCenterPage />} />\n <Route path=\"history\" element={<NotificationHistoryPage />} />\n\n {/* Admin routes - Templates */}\n <Route path=\"templates\" element={<NotificationTemplatesPage />} />\n <Route path=\"templates/new\" element={<TemplateEditorPage />} />\n <Route path=\"templates/:templateId\" element={<TemplateEditorPage />} />\n\n {/* Admin routes - Create/Send Notification */}\n <Route path=\"create\" element={<CreateNotificationPage />} />\n <Route path=\"topics\" element={<NotificationTopicsPage />} />\n <Route path=\"preferences\" element={<NotificationPreferencesPage />} />\n\n {/* Catch-all route - redirect to center (relative path so it works with any basePath) */}\n <Route path=\"*\" element={<Navigate to=\"center\" replace />} />\n </Routes>\n </Suspense>\n );\n}\n"],"mappings":";;;;;;AAQA,IAAM,IAA0B,QAC9B,OAAO,sCAAmC,MAAM,OAAO,EACrD,SAAS,EAAE,yBACZ,EAAE,CACJ,EACK,IAA4B,QAChC,OAAO,wCAAqC,MAAM,OAAO,EACvD,SAAS,EAAE,2BACZ,EAAE,CACJ,EACK,IAAqB,QACzB,OAAO,iCAA8B,MAAM,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,CACtF,EACK,IAAyB,QAC7B,OAAO,qCAAkC,MAAM,OAAO,EAAE,SAAS,EAAE,wBAAwB,EAAE,CAC9F,EACK,IAAyB,QAC7B,OAAO,qCAAkC,MAAM,OAAO,EAAE,SAAS,EAAE,wBAAwB,EAAE,CAC9F,EACK,IAA8B,QAClC,OAAO,0CAAuC,MAAM,OAAO,EACzD,SAAS,EAAE,6BACZ,EAAE,CACJ;AAGD,SAAS,IAAa;AACpB,QACE,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,OAAD,EAAK,WAAU,kFAAmF,CAAA;EAC9F,CAAA;;AAmBV,SAAgB,IAAqB;AACnC,QACE,kBAAC,GAAD;EAAU,UAAU,kBAAC,GAAD,EAAc,CAAA;YAChC,kBAAC,GAAD,EAAA,UAAA;GAEE,kBAAC,GAAD;IAAO,OAAA;IAAM,SAAS,kBAAC,GAAD,EAA2B,CAAA;IAAI,CAAA;GAGrD,kBAAC,GAAD;IAAO,MAAK;IAAS,SAAS,kBAAC,GAAD,EAA0B,CAAA;IAAI,CAAA;GAC5D,kBAAC,GAAD;IAAO,MAAK;IAAU,SAAS,kBAAC,GAAD,EAA2B,CAAA;IAAI,CAAA;GAG9D,kBAAC,GAAD;IAAO,MAAK;IAAY,SAAS,kBAAC,GAAD,EAA6B,CAAA;IAAI,CAAA;GAClE,kBAAC,GAAD;IAAO,MAAK;IAAgB,SAAS,kBAAC,GAAD,EAAsB,CAAA;IAAI,CAAA;GAC/D,kBAAC,GAAD;IAAO,MAAK;IAAwB,SAAS,kBAAC,GAAD,EAAsB,CAAA;IAAI,CAAA;GAGvE,kBAAC,GAAD;IAAO,MAAK;IAAS,SAAS,kBAAC,GAAD,EAA0B,CAAA;IAAI,CAAA;GAC5D,kBAAC,GAAD;IAAO,MAAK;IAAS,SAAS,kBAAC,GAAD,EAA0B,CAAA;IAAI,CAAA;GAC5D,kBAAC,GAAD;IAAO,MAAK;IAAc,SAAS,kBAAC,GAAD,EAA+B,CAAA;IAAI,CAAA;GAGtE,kBAAC,GAAD;IAAO,MAAK;IAAI,SAAS,kBAAC,GAAD;KAAU,IAAG;KAAS,SAAA;KAAU,CAAA;IAAI,CAAA;GACtD,EAAA,CAAA;EACA,CAAA"}
|
|
@@ -2,7 +2,7 @@ import { NotificationCenterPage as e } from "./pages/NotificationCenterPage.js";
|
|
|
2
2
|
import { FeatureDisabledPage as t } from "./components/FeatureDisabledPage.js";
|
|
3
3
|
import { Suspense as n, lazy as r } from "react";
|
|
4
4
|
import { useFeatureFlagDetails as i } from "@burdenoff/fe-libs/shared/feature-flags";
|
|
5
|
-
import { Navigate as a, Route as o, Routes as s } from "react-router
|
|
5
|
+
import { Navigate as a, Route as o, Routes as s } from "react-router";
|
|
6
6
|
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
7
7
|
//#region src/UserNotificationRoutes.tsx
|
|
8
8
|
var u = r(() => import("./pages/NotificationHistoryPage.js").then((e) => ({ default: e.NotificationHistoryPage }))), d = r(() => import("./pages/NotificationPreferencesPage.js").then((e) => ({ default: e.NotificationPreferencesPage })));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserNotificationRoutes.js","names":[],"sources":["../src/UserNotificationRoutes.tsx"],"sourcesContent":["import { lazy, Suspense } from 'react';\nimport { Navigate, Route, Routes } from 'react-router
|
|
1
|
+
{"version":3,"file":"UserNotificationRoutes.js","names":[],"sources":["../src/UserNotificationRoutes.tsx"],"sourcesContent":["import { lazy, Suspense } from 'react';\nimport { Navigate, Route, Routes } from 'react-router';\nimport { useFeatureFlagDetails } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { FeatureDisabledPage } from './components/FeatureDisabledPage';\n\n// Eager load - Primary landing page\nimport { NotificationCenterPage } from './pages/NotificationCenterPage';\n\n// Lazy load - Secondary pages\nconst NotificationHistoryPage = lazy(() =>\n import('./pages/NotificationHistoryPage').then((m) => ({\n default: m.NotificationHistoryPage,\n }))\n);\nconst NotificationPreferencesPage = lazy(() =>\n import('./pages/NotificationPreferencesPage').then((m) => ({\n default: m.NotificationPreferencesPage,\n }))\n);\n\n// Loading fallback component\nfunction PageLoader() {\n return (\n <div className=\"flex h-64 items-center justify-center\">\n <div className=\"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent\" />\n </div>\n );\n}\n\n/**\n * Internal router for the User-facing Notification microfrontend.\n * This component handles routing within the microfrontend using React Router v7.\n *\n * Only exposes user-facing routes intended for product shells. RBAC permissions\n * still gate in-page actions via usePermissions checks.\n *\n * Routes:\n * - / → Redirect to notification center\n * - /center → Notification center (in-app notifications)\n * - /history → Notification history and archive\n * - /preferences → Topic subscriptions and preferences\n */\nexport function UserNotificationRoutes() {\n // Component-level feature gate. `notification.history` is declared as\n // unreleased (defaultValue=false). We use `useFeatureFlagDetails` and\n // explicitly fall back to `false` when the flag is absent from the cache,\n // because the provider's global default-allow would otherwise return `true`\n // for unseeded flags — which would defeat the whole point of the unreleased\n // pattern.\n const historyDetails = useFeatureFlagDetails('notification.history');\n const historyEnabled = historyDetails ? Boolean(historyDetails.value) : false;\n\n return (\n <Suspense fallback={<PageLoader />}>\n <Routes>\n {/* Default redirect to notification center */}\n <Route index element={<Navigate to=\"center\" replace />} />\n\n {/* User-facing routes (all users) */}\n <Route path=\"center\" element={<NotificationCenterPage />} />\n <Route\n path=\"history\"\n element={\n historyEnabled ? (\n <NotificationHistoryPage />\n ) : (\n <FeatureDisabledPage\n title=\"Notification history is not enabled\"\n description=\"This page is controlled by the notification.history feature flag. Ask an administrator to enable it for this tenant if history should be available.\"\n />\n )\n }\n />\n <Route path=\"preferences\" element={<NotificationPreferencesPage />} />\n\n {/* Catch-all route - redirect to index using path-relative navigation */}\n <Route path=\"*\" element={<Navigate to=\"..\" replace relative=\"path\" />} />\n </Routes>\n </Suspense>\n );\n}\n"],"mappings":";;;;;;;AASA,IAAM,IAA0B,QAC9B,OAAO,sCAAmC,MAAM,OAAO,EACrD,SAAS,EAAE,yBACZ,EAAE,CACJ,EACK,IAA8B,QAClC,OAAO,0CAAuC,MAAM,OAAO,EACzD,SAAS,EAAE,6BACZ,EAAE,CACJ;AAGD,SAAS,IAAa;AACpB,QACE,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,OAAD,EAAK,WAAU,kFAAmF,CAAA;EAC9F,CAAA;;AAiBV,SAAgB,IAAyB;CAOvC,IAAM,IAAiB,EAAsB,uBAAuB,EAC9D,IAAiB,IAAiB,EAAQ,EAAe,QAAS;AAExE,QACE,kBAAC,GAAD;EAAU,UAAU,kBAAC,GAAD,EAAc,CAAA;YAChC,kBAAC,GAAD,EAAA,UAAA;GAEE,kBAAC,GAAD;IAAO,OAAA;IAAM,SAAS,kBAAC,GAAD;KAAU,IAAG;KAAS,SAAA;KAAU,CAAA;IAAI,CAAA;GAG1D,kBAAC,GAAD;IAAO,MAAK;IAAS,SAAS,kBAAC,GAAD,EAA0B,CAAA;IAAI,CAAA;GAC5D,kBAAC,GAAD;IACE,MAAK;IACL,SACE,IACE,kBAAC,GAAD,EAA2B,CAAA,GAE3B,kBAAC,GAAD;KACE,OAAM;KACN,aAAY;KACZ,CAAA;IAGN,CAAA;GACF,kBAAC,GAAD;IAAO,MAAK;IAAc,SAAS,kBAAC,GAAD,EAA+B,CAAA;IAAI,CAAA;GAGtE,kBAAC,GAAD;IAAO,MAAK;IAAI,SAAS,kBAAC,GAAD;KAAU,IAAG;KAAK,SAAA;KAAQ,UAAS;KAAS,CAAA;IAAI,CAAA;GAClE,EAAA,CAAA;EACA,CAAA"}
|
|
@@ -11,7 +11,7 @@ import { RecipientSelector as ae } from "../components/RecipientSelector.js";
|
|
|
11
11
|
import { useMemo as a, useState as o } from "react";
|
|
12
12
|
import { useGlobalUi as oe, usePermissions as se } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
13
13
|
import { AlertCircle as ce, ArrowLeft as le, Bell as ue, CheckCircle2 as s, Eye as de, EyeOff as fe, FileText as pe, ImagePlus as me, Link2 as he, Loader2 as c, Mail as ge, MessageSquare as l, Send as _e, Smartphone as ve, User as u, Users as ye, X as be } from "lucide-react";
|
|
14
|
-
import { useNavigate as xe } from "react-router
|
|
14
|
+
import { useNavigate as xe } from "react-router";
|
|
15
15
|
import { Fragment as Se, jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
16
16
|
import { CTAOverflowMenu as Ce, GlassCard as we, IllustratedEmptyState as Te, NextSteps as Ee, PagePurpose as De } from "@burdenoff/fe-libs/ui";
|
|
17
17
|
//#region src/pages/CreateNotificationPage.tsx
|