@tulip-systems/core 0.5.8 → 0.5.9
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/components/client.mjs +7 -7
- package/dist/components/common/icons.d.mts +52 -52
- package/dist/components/common/icons.d.mts.map +1 -1
- package/dist/components/common/status.d.mts +3 -3
- package/dist/components/common/status.d.mts.map +1 -1
- package/dist/components/editor/components/content.client.d.mts +2 -2
- package/dist/components/editor/components/content.client.d.mts.map +1 -1
- package/dist/components/editor/components/editor.client.d.mts +7 -7
- package/dist/components/editor/components/editor.client.d.mts.map +1 -1
- package/dist/components/editor/components/menu.client.d.mts +3 -3
- package/dist/components/editor/components/menu.client.d.mts.map +1 -1
- package/dist/components/editor/components/menu.client.mjs +1 -1
- package/dist/components/editor/lib/constants.d.mts +27 -27
- package/dist/components/header/back-button.client.d.mts +2 -2
- package/dist/components/header/back-button.client.d.mts.map +1 -1
- package/dist/components/header/bottom-bar.client.d.mts +3 -3
- package/dist/components/header/bottom-bar.client.d.mts.map +1 -1
- package/dist/components/header/bottom-bar.client.mjs +1 -1
- package/dist/components/header/breadcrumbs.client.d.mts +7 -7
- package/dist/components/header/breadcrumbs.client.d.mts.map +1 -1
- package/dist/components/header/breadcrumbs.client.mjs +1 -1
- package/dist/components/header/header.client.d.mts +2 -2
- package/dist/components/header/header.client.d.mts.map +1 -1
- package/dist/components/header/mobile-nav-switcher.client.d.mts +2 -2
- package/dist/components/header/mobile-nav-switcher.client.d.mts.map +1 -1
- package/dist/components/header/top-bar.client.d.mts +4 -4
- package/dist/components/header/top-bar.client.d.mts.map +1 -1
- package/dist/components/header/top-bar.client.mjs +1 -1
- package/dist/components/layouts/admin-content.client.d.mts +2 -2
- package/dist/components/layouts/admin-content.client.d.mts.map +1 -1
- package/dist/components/layouts/admin-error-pages.d.mts +23 -0
- package/dist/components/layouts/admin-error-pages.d.mts.map +1 -0
- package/dist/components/layouts/admin-error-pages.mjs +60 -0
- package/dist/components/layouts/admin-error-pages.mjs.map +1 -0
- package/dist/components/layouts/admin-layout.d.mts +2 -2
- package/dist/components/layouts/admin-layout.d.mts.map +1 -1
- package/dist/components/layouts/admin-loading.d.mts +2 -2
- package/dist/components/layouts/admin-loading.d.mts.map +1 -1
- package/dist/components/layouts/empty-page.d.mts +4 -4
- package/dist/components/layouts/empty-page.d.mts.map +1 -1
- package/dist/components/layouts/empty-page.mjs.map +1 -1
- package/dist/components/layouts/error-page.d.mts +35 -10
- package/dist/components/layouts/error-page.d.mts.map +1 -1
- package/dist/components/layouts/error-page.mjs +36 -40
- package/dist/components/layouts/error-page.mjs.map +1 -1
- package/dist/components/layouts/error-sections.d.mts +29 -0
- package/dist/components/layouts/error-sections.d.mts.map +1 -0
- package/dist/components/layouts/error-sections.mjs +47 -0
- package/dist/components/layouts/error-sections.mjs.map +1 -0
- package/dist/components/layouts/list-layout.d.mts +2 -2
- package/dist/components/layouts/list-layout.d.mts.map +1 -1
- package/dist/components/layouts/providers.client.d.mts +2 -2
- package/dist/components/layouts/providers.client.d.mts.map +1 -1
- package/dist/components/layouts/root-error-pages.d.mts +10 -0
- package/dist/components/layouts/root-error-pages.d.mts.map +1 -0
- package/dist/components/layouts/root-error-pages.mjs +17 -0
- package/dist/components/layouts/root-error-pages.mjs.map +1 -0
- package/dist/components/layouts/root-layout.server.d.mts +2 -2
- package/dist/components/layouts/root-layout.server.d.mts.map +1 -1
- package/dist/components/layouts/root-loading.d.mts +2 -2
- package/dist/components/layouts/root-loading.d.mts.map +1 -1
- package/dist/components/layouts/tab-layout.d.mts +2 -2
- package/dist/components/layouts/tab-layout.d.mts.map +1 -1
- package/dist/components/layouts/tab-layout.mjs +1 -1
- package/dist/components/lists/data-list.d.mts +5 -5
- package/dist/components/lists/data-list.d.mts.map +1 -1
- package/dist/components/lists/data-stack.d.mts +8 -8
- package/dist/components/lists/data-stack.d.mts.map +1 -1
- package/dist/components/navigation/admin-sidebar-header.client.mjs +2 -2
- package/dist/components/navigation/admin-sidebar-paths.client.d.mts +10 -10
- package/dist/components/navigation/admin-sidebar-paths.client.mjs +1 -1
- package/dist/components/navigation/admin-sidebar-skeleton.mjs +1 -1
- package/dist/components/ui/accordion.d.mts +5 -5
- package/dist/components/ui/accordion.d.mts.map +1 -1
- package/dist/components/ui/alert-dialog.d.mts +12 -12
- package/dist/components/ui/alert-dialog.d.mts.map +1 -1
- package/dist/components/ui/alert.d.mts +6 -6
- package/dist/components/ui/alert.d.mts.map +1 -1
- package/dist/components/ui/aspect-ratio.d.mts +2 -2
- package/dist/components/ui/aspect-ratio.d.mts.map +1 -1
- package/dist/components/ui/avatar.client.d.mts +4 -4
- package/dist/components/ui/badge.d.mts +4 -4
- package/dist/components/ui/badge.d.mts.map +1 -1
- package/dist/components/ui/breadcrumb.d.mts +8 -8
- package/dist/components/ui/breadcrumb.d.mts.map +1 -1
- package/dist/components/ui/button.d.mts +5 -5
- package/dist/components/ui/calendar.d.mts +3 -3
- package/dist/components/ui/card.d.mts +7 -7
- package/dist/components/ui/carousel.d.mts +6 -6
- package/dist/components/ui/chart.client.d.mts +5 -5
- package/dist/components/ui/checkbox.d.mts +2 -2
- package/dist/components/ui/collapsible.client.d.mts +4 -4
- package/dist/components/ui/color-picker.client.d.mts +2 -2
- package/dist/components/ui/combobox-dropdown.client.d.mts +2 -2
- package/dist/components/ui/combobox-dropdown.client.mjs +1 -1
- package/dist/components/ui/combobox.client.d.mts +2 -2
- package/dist/components/ui/combobox.client.mjs +1 -1
- package/dist/components/ui/command.d.mts +10 -10
- package/dist/components/ui/context-menu.d.mts +16 -16
- package/dist/components/ui/date-picker.client.d.mts +2 -2
- package/dist/components/ui/date-picker.client.mjs +1 -1
- package/dist/components/ui/dialog.client.d.mts +11 -11
- package/dist/components/ui/drawer.client.d.mts +11 -11
- package/dist/components/ui/dropdown-menu.d.mts +16 -16
- package/dist/components/ui/form.client.d.mts +7 -7
- package/dist/components/ui/hover-card.client.d.mts +4 -4
- package/dist/components/ui/input-recipient.d.mts +2 -2
- package/dist/components/ui/input.d.mts +2 -2
- package/dist/components/ui/label.d.mts +2 -2
- package/dist/components/ui/navigation-menu.d.mts +11 -11
- package/dist/components/ui/pagination.d.mts +8 -8
- package/dist/components/ui/popover.d.mts +5 -5
- package/dist/components/ui/progress.client.d.mts +2 -2
- package/dist/components/ui/radio-group.d.mts +3 -3
- package/dist/components/ui/resizable.client.d.mts +4 -4
- package/dist/components/ui/scroll-area.d.mts +3 -3
- package/dist/components/ui/select.client.d.mts +11 -11
- package/dist/components/ui/separator.d.mts +2 -2
- package/dist/components/ui/sheet.client.d.mts +9 -9
- package/dist/components/ui/sidebar.client.d.mts +26 -26
- package/dist/components/ui/sidebar.client.mjs +2 -2
- package/dist/components/ui/skeleton.d.mts +2 -2
- package/dist/components/ui/slider.d.mts +2 -2
- package/dist/components/ui/sonner.client.d.mts +2 -2
- package/dist/components/ui/switch.d.mts +2 -2
- package/dist/components/ui/tabs.d.mts +5 -5
- package/dist/components/ui/textarea.d.mts +2 -2
- package/dist/components/ui/time-input.client.d.mts +2 -2
- package/dist/components/ui/toggle-group.client.d.mts +3 -3
- package/dist/components/ui/toggle.d.mts +4 -4
- package/dist/components/ui/toggle.d.mts.map +1 -1
- package/dist/components/ui/tooltip.client.d.mts +5 -5
- package/dist/components/ui/tooltip.client.d.mts.map +1 -1
- package/dist/components.d.mts +5 -4
- package/dist/components.mjs +18 -17
- package/dist/lib/hooks/use-action.d.mts +2 -2
- package/dist/lib/hooks/use-indicator.d.mts +2 -2
- package/dist/lib.mjs +1 -1
- package/dist/modules/auth/components/allowed.client.d.mts +2 -2
- package/dist/modules/auth/components/auth-layout.server.d.mts +2 -2
- package/dist/modules/auth/components/auth-loading.d.mts +2 -2
- package/dist/modules/auth/components/auth-loading.d.mts.map +1 -1
- package/dist/modules/auth/components/create-first-user-page.client.d.mts +2 -2
- package/dist/modules/auth/components/create-first-user-page.client.mjs +1 -1
- package/dist/modules/auth/components/forget-password-page.client.d.mts +2 -2
- package/dist/modules/auth/components/guard-first-user.server.d.mts +2 -2
- package/dist/modules/auth/components/guard.server.d.mts +2 -2
- package/dist/modules/auth/components/login-page.client.d.mts +2 -2
- package/dist/modules/auth/components/login-page.client.mjs +1 -1
- package/dist/modules/auth/components/reset-password-page.client.d.mts +2 -2
- package/dist/modules/auth/components/reset-password-page.client.mjs +1 -1
- package/dist/modules/auth/components/update-password-command.d.mts +2 -2
- package/dist/modules/auth/db/schema.d.mts +73 -73
- package/dist/modules/auth/db/schema.d.mts.map +1 -1
- package/dist/modules/auth/handler/client.client.d.mts +147 -147
- package/dist/modules/auth/handler/client.client.d.mts.map +1 -1
- package/dist/modules/auth/handler/init.d.mts +131 -131
- package/dist/modules/auth/handler/init.d.mts.map +1 -1
- package/dist/modules/auth/lib/helpers.server.d.mts +2 -2
- package/dist/modules/auth/lib/validators.d.mts +2 -2
- package/dist/modules/auth/lib/validators.d.mts.map +1 -1
- package/dist/modules/commands/components/alert-dialog-command.client.d.mts +10 -10
- package/dist/modules/commands/components/alert-dialog-command.client.d.mts.map +1 -1
- package/dist/modules/commands/components/click-command.client.d.mts +2 -2
- package/dist/modules/commands/components/click-command.client.d.mts.map +1 -1
- package/dist/modules/commands/components/command-trigger.client.d.mts +6 -6
- package/dist/modules/commands/components/command-trigger.client.d.mts.map +1 -1
- package/dist/modules/commands/components/command-trigger.client.mjs +1 -1
- package/dist/modules/commands/components/dialog-command.client.d.mts +8 -8
- package/dist/modules/commands/components/dialog-command.client.d.mts.map +1 -1
- package/dist/modules/commands/components/dialog-command.client.mjs +1 -1
- package/dist/modules/commands/components/dropdown-command.client.d.mts +5 -5
- package/dist/modules/commands/components/dropdown-command.client.d.mts.map +1 -1
- package/dist/modules/commands/components/empty-command.client.d.mts +2 -2
- package/dist/modules/commands/components/empty-command.client.d.mts.map +1 -1
- package/dist/modules/commands/components/form-dialog-command.client.d.mts +11 -11
- package/dist/modules/commands/components/form-dialog-command.client.d.mts.map +1 -1
- package/dist/modules/commands/components/form-dialog-command.client.mjs +1 -1
- package/dist/modules/commands/hooks/use-command-mutation.client.d.mts +3 -3
- package/dist/modules/commands/menus/context-menu.client.d.mts +2 -2
- package/dist/modules/commands/menus/context-menu.client.d.mts.map +1 -1
- package/dist/modules/commands/menus/dropdown-menu.client.d.mts +3 -3
- package/dist/modules/commands/menus/dropdown-menu.client.d.mts.map +1 -1
- package/dist/modules/commands/menus/dropdown-menu.client.mjs +1 -1
- package/dist/modules/commands/menus/inline-menu.client.d.mts +3 -3
- package/dist/modules/commands/menus/inline-menu.client.d.mts.map +1 -1
- package/dist/modules/commands/menus/responsive-menu.client.d.mts +3 -3
- package/dist/modules/commands/menus/responsive-menu.client.d.mts.map +1 -1
- package/dist/modules/commands/utils/archive-command.client.d.mts +3 -3
- package/dist/modules/commands/utils/archive-command.client.d.mts.map +1 -1
- package/dist/modules/commands/utils/delete-command.client.d.mts +3 -3
- package/dist/modules/commands/utils/delete-command.client.d.mts.map +1 -1
- package/dist/modules/config/db/helpers.d.mts +5 -5
- package/dist/modules/config/db/helpers.d.mts.map +1 -1
- package/dist/modules/data-tables/components/cell/common.client.d.mts +5 -5
- package/dist/modules/data-tables/components/cell/common.client.d.mts.map +1 -1
- package/dist/modules/data-tables/components/column-header.d.mts +2 -2
- package/dist/modules/data-tables/components/filters/combobox.client.d.mts +2 -2
- package/dist/modules/data-tables/components/filters/combobox.client.d.mts.map +1 -1
- package/dist/modules/data-tables/components/filters/combobox.client.mjs +1 -1
- package/dist/modules/data-tables/components/filters/slider.client.d.mts +2 -2
- package/dist/modules/data-tables/components/filters/slider.client.d.mts.map +1 -1
- package/dist/modules/data-tables/components/filters/slider.client.mjs +1 -1
- package/dist/modules/data-tables/components/header.d.mts +4 -4
- package/dist/modules/data-tables/components/layout.d.mts +2 -2
- package/dist/modules/data-tables/components/search-input.client.d.mts +2 -2
- package/dist/modules/data-tables/components/search-input.client.d.mts.map +1 -1
- package/dist/modules/data-tables/components/skeleton.d.mts +2 -2
- package/dist/modules/data-tables/components/table.d.mts +7 -7
- package/dist/modules/data-tables/components/toolbar.d.mts +3 -3
- package/dist/modules/data-tables/hooks/use-context.client.d.mts +2 -2
- package/dist/modules/data-tables/hooks/use-context.client.d.mts.map +1 -1
- package/dist/modules/data-tables/lib/converters/search.mjs +2 -2
- package/dist/modules/data-tables/lib/converters/search.mjs.map +1 -1
- package/dist/modules/data-tables/tables/data-table/components/table.d.mts +2 -2
- package/dist/modules/data-tables/tables/data-table/components/table.d.mts.map +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/cells/common.d.mts +2 -2
- package/dist/modules/data-tables/tables/inline-table/components/cells/common.d.mts.map +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/cells/drag-handle.client.d.mts +2 -2
- package/dist/modules/data-tables/tables/inline-table/components/cells/drag-handle.client.d.mts.map +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/cells/read-only.d.mts +2 -2
- package/dist/modules/data-tables/tables/inline-table/components/cells/read-only.d.mts.map +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/table.d.mts +2 -2
- package/dist/modules/data-tables/tables/inline-table/components/table.d.mts.map +1 -1
- package/dist/modules/data-tables/tables/inline-table/hooks/context.client.d.mts +2 -2
- package/dist/modules/data-tables/tables/inline-table/hooks/context.client.d.mts.map +1 -1
- package/dist/modules/data-tables/tables/inline-table/hooks/context.client.mjs +1 -1
- package/dist/modules/inline-edit/components/combobox-dropdown.client.d.mts +2 -2
- package/dist/modules/inline-edit/components/combobox.client.d.mts +2 -2
- package/dist/modules/inline-edit/components/date-input.client.d.mts +2 -2
- package/dist/modules/inline-edit/components/date-input.client.mjs +1 -1
- package/dist/modules/inline-edit/components/date-picker.client.d.mts +2 -2
- package/dist/modules/inline-edit/components/date-picker.client.mjs +1 -1
- package/dist/modules/inline-edit/components/editor.client.d.mts +2 -2
- package/dist/modules/inline-edit/components/input-recipient.client.d.mts +2 -2
- package/dist/modules/inline-edit/components/input-toggle.client.d.mts +2 -2
- package/dist/modules/inline-edit/components/input.client.d.mts +4 -4
- package/dist/modules/inline-edit/components/select.client.d.mts +6 -6
- package/dist/modules/inline-edit/components/switch.client.d.mts +2 -2
- package/dist/modules/inline-edit/components/toggle.client.d.mts +2 -2
- package/dist/modules/inline-edit/hooks/context.client.d.mts +2 -2
- package/dist/modules/inline-edit/lib/variants.d.mts +2 -2
- package/dist/modules/router/lib/query-client.server.d.mts +2 -2
- package/dist/modules/storage/components/dropzone.client.d.mts +5 -5
- package/dist/modules/storage/components/image-grid.client.d.mts +3 -3
- package/dist/modules/storage/components/image-grid.client.mjs +3 -3
- package/dist/modules/storage/components/upload-zone.client.d.mts +2 -2
- package/dist/modules/storage/lib/router.server.d.mts +2311 -2311
- package/dist/modules/storage/lib/router.server.d.mts.map +1 -1
- package/dist/modules/storage/lib/schema.d.mts +92 -92
- package/dist/modules/storage/lib/schema.mjs +1 -1
- package/dist/modules/storage/lib/service.server.d.mts +15 -15
- package/dist/modules/storage/lib/service.server.mjs +1 -1
- package/dist/modules/storage/lib/validators.d.mts +80 -80
- package/package.json +1 -1
- package/src/components/entry.ts +3 -2
- package/src/components/layouts/admin-error-pages.tsx +109 -0
- package/src/components/layouts/empty-page.tsx +0 -17
- package/src/components/layouts/error-page.tsx +58 -44
- package/src/components/layouts/error-sections.tsx +52 -0
- package/src/components/layouts/root-error-pages.tsx +12 -0
- package/src/modules/data-tables/lib/converters/search.ts +2 -2
- package/dist/components/layouts/not-allowed-page.d.mts +0 -22
- package/dist/components/layouts/not-allowed-page.d.mts.map +0 -1
- package/dist/components/layouts/not-allowed-page.mjs +0 -25
- package/dist/components/layouts/not-allowed-page.mjs.map +0 -1
- package/dist/components/layouts/not-found-page.d.mts +0 -8
- package/dist/components/layouts/not-found-page.d.mts.map +0 -1
- package/dist/components/layouts/not-found-page.mjs +0 -20
- package/dist/components/layouts/not-found-page.mjs.map +0 -1
- package/dist/components/layouts/not-found-section.mjs +0 -30
- package/dist/components/layouts/not-found-section.mjs.map +0 -1
- package/src/components/layouts/not-allowed-page.tsx +0 -44
- package/src/components/layouts/not-found-page.tsx +0 -17
- package/src/components/layouts/not-found-section.tsx +0 -26
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { ServerError } from "@/modules/router/lib/error.server";
|
|
2
|
+
import { CommonORPCErrorCode } from "@orpc/client";
|
|
3
|
+
import { Header } from "../header/header.client";
|
|
4
|
+
import { Topbar, TopbarTitle } from "../header/top-bar.client";
|
|
5
|
+
import {
|
|
6
|
+
DefaultErrorSection,
|
|
7
|
+
NotAllowedSection,
|
|
8
|
+
NotFoundSection,
|
|
9
|
+
ServerErrorSection,
|
|
10
|
+
} from "./error-sections";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Admin Not Found Page
|
|
14
|
+
*/
|
|
15
|
+
export function AdminNotFoundPage() {
|
|
16
|
+
return (
|
|
17
|
+
<>
|
|
18
|
+
<Header>
|
|
19
|
+
<Topbar>
|
|
20
|
+
<TopbarTitle breadcrumbs={[{ label: "404" }]} />
|
|
21
|
+
</Topbar>
|
|
22
|
+
</Header>
|
|
23
|
+
|
|
24
|
+
<div className="p-content">
|
|
25
|
+
<NotFoundSection className="min-h-[calc(100dvh-var(--header-top-bar-height)-var(--content)-var(--content))]" />
|
|
26
|
+
</div>
|
|
27
|
+
</>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Admin Not Allowed Page
|
|
33
|
+
*/
|
|
34
|
+
export function AdminNotAllowedPage() {
|
|
35
|
+
return (
|
|
36
|
+
<>
|
|
37
|
+
<Header>
|
|
38
|
+
<Topbar>
|
|
39
|
+
<TopbarTitle breadcrumbs={[{ label: "Unauthorized" }]} />
|
|
40
|
+
</Topbar>
|
|
41
|
+
</Header>
|
|
42
|
+
|
|
43
|
+
<div className="p-content">
|
|
44
|
+
<NotAllowedSection className="min-h-[calc(100dvh-var(--header-top-bar-height)-var(--content)-var(--content))]" />
|
|
45
|
+
</div>
|
|
46
|
+
</>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* ErrorPage
|
|
52
|
+
* - If the error is a ServerError and the code is "UNAUTHORIZED", show the NotAllowedPage
|
|
53
|
+
* - If the error is a ServerError and the code is "NOT_FOUND", show the NotFoundSection
|
|
54
|
+
* - Else show the ErrorPage
|
|
55
|
+
*/
|
|
56
|
+
export function AdminErrorPage(props: { error: Error }) {
|
|
57
|
+
const serverErrorCode: CommonORPCErrorCode =
|
|
58
|
+
props.error instanceof ServerError ? props.error.code : undefined;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* If the error is a ServerError and the code is "UNAUTHORIZED", show the NotAllowedPage
|
|
62
|
+
*/
|
|
63
|
+
if (serverErrorCode === "UNAUTHORIZED") {
|
|
64
|
+
return <AdminNotAllowedPage />;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* If the error is a ServerError and the code is "UNAUTHORIZED", show the NotAllowedPage
|
|
69
|
+
*/
|
|
70
|
+
if (serverErrorCode === "NOT_FOUND") {
|
|
71
|
+
return <AdminNotFoundPage />;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* If the error is a ServerError and the code is "UNAUTHORIZED", show the NotAllowedPage
|
|
76
|
+
*/
|
|
77
|
+
if (serverErrorCode === "INTERNAL_SERVER_ERROR") {
|
|
78
|
+
return (
|
|
79
|
+
<>
|
|
80
|
+
<Header>
|
|
81
|
+
<Topbar>
|
|
82
|
+
<TopbarTitle breadcrumbs={[{ label: "Server Error" }]} />
|
|
83
|
+
</Topbar>
|
|
84
|
+
</Header>
|
|
85
|
+
|
|
86
|
+
<div className="p-content">
|
|
87
|
+
<ServerErrorSection className="min-h-[calc(100dvh-var(--header-top-bar-height)-var(--content)-var(--content))]" />
|
|
88
|
+
</div>
|
|
89
|
+
</>
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Else show the ErrorPage
|
|
95
|
+
*/
|
|
96
|
+
return (
|
|
97
|
+
<>
|
|
98
|
+
<Header>
|
|
99
|
+
<Topbar>
|
|
100
|
+
<TopbarTitle breadcrumbs={[{ label: "Error" }]} />
|
|
101
|
+
</Topbar>
|
|
102
|
+
</Header>
|
|
103
|
+
|
|
104
|
+
<div className="p-content">
|
|
105
|
+
<DefaultErrorSection className="min-h-[calc(100dvh-var(--header-top-bar-height)-var(--content)-var(--content))]" />
|
|
106
|
+
</div>
|
|
107
|
+
</>
|
|
108
|
+
);
|
|
109
|
+
}
|
|
@@ -40,20 +40,3 @@ export function EmptyPageDescription({ className, children, ...props }: Componen
|
|
|
40
40
|
</p>
|
|
41
41
|
);
|
|
42
42
|
}
|
|
43
|
-
|
|
44
|
-
{
|
|
45
|
-
/* <div className="flex h-full flex-col place-items-center justify-center space-y-6 border border-dashed">
|
|
46
|
-
<span className="space-y-2 text-center">
|
|
47
|
-
<h2 className="text-2xl font-bold tracking-tight">{title}</h2>
|
|
48
|
-
{description && (
|
|
49
|
-
<p className="text-muted-foreground max-w-[40ch] text-sm">{description}</p>
|
|
50
|
-
)}
|
|
51
|
-
</span>
|
|
52
|
-
|
|
53
|
-
{callToAction && (
|
|
54
|
-
<Link href={callToAction.href} className={cn(buttonVariants({ variant: "default" }))}>
|
|
55
|
-
{callToAction.title}
|
|
56
|
-
</Link>
|
|
57
|
-
)}
|
|
58
|
-
</div> */
|
|
59
|
-
}
|
|
@@ -1,61 +1,75 @@
|
|
|
1
1
|
import { cn } from "@/lib/utils/cn";
|
|
2
|
-
import {
|
|
3
|
-
import { CommonORPCErrorCode } from "@orpc/client";
|
|
4
|
-
import { BugIcon } from "lucide-react";
|
|
2
|
+
import { BugIcon, ServerCrashIcon, ShieldBanIcon } from "lucide-react";
|
|
5
3
|
import { ComponentProps } from "react";
|
|
6
|
-
import { NotAllowedPage } from "./not-allowed-page";
|
|
7
|
-
import { NotFoundSection } from "./not-found-section";
|
|
8
4
|
|
|
9
5
|
/**
|
|
10
6
|
* ErrorPage
|
|
11
7
|
*/
|
|
12
|
-
export function ErrorPage({ className, ...props }: ComponentProps<"div">) {
|
|
8
|
+
export function ErrorPage({ className, children, ...props }: ComponentProps<"div">) {
|
|
13
9
|
return (
|
|
14
|
-
<div
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
10
|
+
<div
|
|
11
|
+
{...props}
|
|
12
|
+
className={cn(
|
|
13
|
+
"min-h-120 flex h-full w-full flex-col items-center justify-center gap-y-3 border border-dashed text-center",
|
|
14
|
+
className,
|
|
15
|
+
)}
|
|
16
|
+
>
|
|
17
|
+
{children}
|
|
21
18
|
</div>
|
|
22
19
|
);
|
|
23
20
|
}
|
|
24
21
|
|
|
25
22
|
/**
|
|
26
|
-
*
|
|
27
|
-
* - If the error is a ServerError and the code is "UNAUTHORIZED", show the NotAllowedPage
|
|
28
|
-
* - If the error is a ServerError and the code is "NOT_FOUND", show the NotFoundSection
|
|
29
|
-
* - Else show the ErrorPage
|
|
23
|
+
* ErrorPageCode
|
|
30
24
|
*/
|
|
31
|
-
export function
|
|
32
|
-
|
|
33
|
-
|
|
25
|
+
export function ErrorPageCode({ className, children, ...props }: ComponentProps<"h2">) {
|
|
26
|
+
return (
|
|
27
|
+
<h2 className={cn("text-9xl font-bold leading-none", className)} {...props}>
|
|
28
|
+
{children}
|
|
29
|
+
</h2>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
34
32
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
33
|
+
/**
|
|
34
|
+
* ErrorPageIcon
|
|
35
|
+
*/
|
|
36
|
+
const errorPageIcons = {
|
|
37
|
+
serverError: ServerCrashIcon,
|
|
38
|
+
notAllowed: ShieldBanIcon,
|
|
39
|
+
default: BugIcon,
|
|
40
|
+
// 404: BombIcon,
|
|
41
|
+
};
|
|
45
42
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
<NotFoundSection href="/admin" />
|
|
53
|
-
</div>
|
|
54
|
-
);
|
|
55
|
-
}
|
|
43
|
+
export function ErrorPageIcon({
|
|
44
|
+
variant = "default",
|
|
45
|
+
className,
|
|
46
|
+
...props
|
|
47
|
+
}: ComponentProps<"svg"> & { variant?: keyof typeof errorPageIcons }) {
|
|
48
|
+
const Icon = errorPageIcons[variant];
|
|
56
49
|
|
|
57
|
-
|
|
58
|
-
* Else show the ErrorPage
|
|
59
|
-
*/
|
|
60
|
-
return <ErrorPage />;
|
|
50
|
+
return <Icon className={cn("size-16 xl:size-24", className)} {...props} />;
|
|
61
51
|
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* ErrorPageDescription
|
|
55
|
+
*/
|
|
56
|
+
export function ErrorPageDescription({ className, children, ...props }: ComponentProps<"p">) {
|
|
57
|
+
return (
|
|
58
|
+
<p className={cn("text-2xl font-bold lg:text-3xl", className)} {...props}>
|
|
59
|
+
{children}
|
|
60
|
+
</p>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// export function ErrorPage({ className, ...props }: ComponentProps<"div">) {
|
|
65
|
+
// return (
|
|
66
|
+
// <div {...props} className={cn("relative z-0 grid w-full place-items-center", className)}>
|
|
67
|
+
// <div className="flex flex-col items-center gap-12 text-center">
|
|
68
|
+
// <span className="text-destructive flex flex-col items-center gap-2">
|
|
69
|
+
// <BugIcon className="size-20 xl:size-32" />
|
|
70
|
+
// <h1 className="text-2xl font-bold lg:text-3xl">Oeps, er is iets fout gegaan.</h1>
|
|
71
|
+
// </span>
|
|
72
|
+
// </div>
|
|
73
|
+
// </div>
|
|
74
|
+
// );
|
|
75
|
+
// }
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { cn } from "@/lib/utils/cn";
|
|
2
|
+
import { ComponentProps } from "react";
|
|
3
|
+
import { ErrorPage, ErrorPageCode, ErrorPageDescription, ErrorPageIcon } from "./error-page";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* DefaultErrorSection
|
|
7
|
+
*/
|
|
8
|
+
export function DefaultErrorSection({ className, ...props }: ComponentProps<"div">) {
|
|
9
|
+
return (
|
|
10
|
+
<ErrorPage {...props} className={cn("text-destructive", className)}>
|
|
11
|
+
{/* <BugIcon className="size-16 xl:size-24" /> */}
|
|
12
|
+
<ErrorPageIcon variant="default" />
|
|
13
|
+
<ErrorPageDescription>Oeps, er is iets fout gegaan</ErrorPageDescription>
|
|
14
|
+
</ErrorPage>
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* ServerErrorSection
|
|
20
|
+
*/
|
|
21
|
+
export function ServerErrorSection({ className, ...props }: ComponentProps<"div">) {
|
|
22
|
+
return (
|
|
23
|
+
<ErrorPage {...props} className={cn("text-destructive", className)}>
|
|
24
|
+
<ErrorPageIcon variant="serverError" />
|
|
25
|
+
<ErrorPageDescription>Oeps, er is iets fout gegaan met de server</ErrorPageDescription>
|
|
26
|
+
</ErrorPage>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* NotFoundSection
|
|
32
|
+
*/
|
|
33
|
+
export function NotFoundSection(props: ComponentProps<"div">) {
|
|
34
|
+
return (
|
|
35
|
+
<ErrorPage {...props}>
|
|
36
|
+
<ErrorPageCode>404</ErrorPageCode>
|
|
37
|
+
<ErrorPageDescription>Oeps, deze pagina is niet gevonden.</ErrorPageDescription>
|
|
38
|
+
</ErrorPage>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Not Allowed Section
|
|
44
|
+
*/
|
|
45
|
+
export function NotAllowedSection(props: ComponentProps<"div">) {
|
|
46
|
+
return (
|
|
47
|
+
<ErrorPage {...props}>
|
|
48
|
+
<ErrorPageIcon variant="notAllowed" />
|
|
49
|
+
<ErrorPageDescription>Je hebt geen toegang tot deze pagina.</ErrorPageDescription>
|
|
50
|
+
</ErrorPage>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { NotFoundSection } from "./error-sections";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Admin Not Found Page
|
|
5
|
+
*/
|
|
6
|
+
export function RootNotFoundPage() {
|
|
7
|
+
return (
|
|
8
|
+
<div className="relative z-0 grid h-dvh w-full place-items-center">
|
|
9
|
+
<NotFoundSection className="h-full" />
|
|
10
|
+
</div>
|
|
11
|
+
);
|
|
12
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type SQL, ilike, or } from "drizzle-orm";
|
|
1
|
+
import { type SQL, ilike, or, sql } from "drizzle-orm";
|
|
2
2
|
import type { PgColumn } from "drizzle-orm/pg-core";
|
|
3
3
|
import { TableQuerySchema } from "../validators";
|
|
4
4
|
|
|
@@ -16,7 +16,7 @@ export function convertSearchToQueryParams(
|
|
|
16
16
|
if (!search) return undefined;
|
|
17
17
|
|
|
18
18
|
// create an array of search fields with the search query applied
|
|
19
|
-
const searchFields = fields.map((field) => ilike(field
|
|
19
|
+
const searchFields = fields.map((field) => ilike(sql`${field}::text`, `%${search}%`));
|
|
20
20
|
|
|
21
21
|
// return the query with the search fields
|
|
22
22
|
return or(...searchFields);
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime247 from "react/jsx-runtime";
|
|
2
|
-
import { HTMLAttributes } from "react";
|
|
3
|
-
import { Route } from "next";
|
|
4
|
-
|
|
5
|
-
//#region src/components/layouts/not-allowed-page.d.ts
|
|
6
|
-
type NotAllowedPageProps = HTMLAttributes<HTMLDivElement> & {
|
|
7
|
-
title?: string;
|
|
8
|
-
description?: string;
|
|
9
|
-
callToAction?: {
|
|
10
|
-
href: Route;
|
|
11
|
-
title: string;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
declare function NotAllowedPage({
|
|
15
|
-
title,
|
|
16
|
-
description,
|
|
17
|
-
callToAction,
|
|
18
|
-
...props
|
|
19
|
-
}: NotAllowedPageProps): react_jsx_runtime247.JSX.Element;
|
|
20
|
-
//#endregion
|
|
21
|
-
export { NotAllowedPage, NotAllowedPageProps };
|
|
22
|
-
//# sourceMappingURL=not-allowed-page.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"not-allowed-page.d.mts","names":[],"sources":["../../../src/components/layouts/not-allowed-page.tsx"],"sourcesContent":[],"mappings":";;;;;KAOY,mBAAA,GAAsB,eAAe;;;EAArC,YAAA,CAAA,EAAA;IAAqC,IAAA,EAIvC,KAJuC;IAAf,KAAA,EAAA,MAAA;EAIxB,CAAA;CAAK;AAKC,iBAAA,cAAA,CAAc;EAAA,KAAA;EAAA,WAAA;EAAA,YAAA;EAAA,GAAA;AAAA,CAAA,EAK3B,mBAL2B,CAAA,EAKR,oBAAA,CAAA,GAAA,CAAA,OALQ"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { cn } from "../../lib/utils/cn.mjs";
|
|
2
|
-
import { EmptyPage, EmptyPageDescription, EmptyPageTitle } from "./empty-page.mjs";
|
|
3
|
-
import { buttonVariants } from "../ui/button.mjs";
|
|
4
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
-
import Link from "next/link";
|
|
6
|
-
|
|
7
|
-
//#region src/components/layouts/not-allowed-page.tsx
|
|
8
|
-
function NotAllowedPage({ title, description, callToAction, ...props }) {
|
|
9
|
-
return /* @__PURE__ */ jsxs(EmptyPage, {
|
|
10
|
-
...props,
|
|
11
|
-
children: [
|
|
12
|
-
/* @__PURE__ */ jsx(EmptyPageTitle, { children: title ?? "Geen toegang" }),
|
|
13
|
-
/* @__PURE__ */ jsx(EmptyPageDescription, { children: description ?? "Je hebt geen toegang tot deze pagina." }),
|
|
14
|
-
callToAction && /* @__PURE__ */ jsx(Link, {
|
|
15
|
-
href: callToAction.href,
|
|
16
|
-
className: cn(buttonVariants({ variant: "default" })),
|
|
17
|
-
children: callToAction.title
|
|
18
|
-
})
|
|
19
|
-
]
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
//#endregion
|
|
24
|
-
export { NotAllowedPage };
|
|
25
|
-
//# sourceMappingURL=not-allowed-page.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"not-allowed-page.mjs","names":[],"sources":["../../../src/components/layouts/not-allowed-page.tsx"],"sourcesContent":["import { cn } from \"@/lib/utils/cn\";\nimport type { Route } from \"next\";\nimport Link from \"next/link\";\nimport type { HTMLAttributes } from \"react\";\nimport { buttonVariants } from \"../ui/button\";\nimport { EmptyPage, EmptyPageDescription, EmptyPageTitle } from \"./empty-page\";\n\nexport type NotAllowedPageProps = HTMLAttributes<HTMLDivElement> & {\n title?: string;\n description?: string;\n callToAction?: {\n href: Route;\n title: string;\n };\n};\n\nexport function NotAllowedPage({\n title,\n description,\n callToAction,\n ...props\n}: NotAllowedPageProps) {\n return (\n <EmptyPage {...props}>\n <EmptyPageTitle>{title ?? \"Geen toegang\"}</EmptyPageTitle>\n <EmptyPageDescription>\n {description ?? \"Je hebt geen toegang tot deze pagina.\"}\n </EmptyPageDescription>\n\n {callToAction && (\n <Link href={callToAction.href} className={cn(buttonVariants({ variant: \"default\" }))}>\n {callToAction.title}\n </Link>\n )}\n </EmptyPage>\n );\n}\n\n// <EmptyPage\n// {...props}\n// title={title ?? \"Geen toegang\"}\n// description={description ?? \"Je hebt geen toegang tot deze pagina.\"}\n// callToAction={callToAction ?? { href: \"/admin\", title: \"Terug naar dashboard\" }}\n// />\n"],"mappings":";;;;;;;AAgBA,SAAgB,eAAe,EAC7B,OACA,aACA,cACA,GAAG,SACmB;AACtB,QACE,qBAAC;EAAU,GAAI;;GACb,oBAAC,4BAAgB,SAAS,iBAAgC;GAC1D,oBAAC,kCACE,eAAe,0CACK;GAEtB,gBACC,oBAAC;IAAK,MAAM,aAAa;IAAM,WAAW,GAAG,eAAe,EAAE,SAAS,WAAW,CAAC,CAAC;cACjF,aAAa;KACT;;GAEC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime248 from "react/jsx-runtime";
|
|
2
|
-
|
|
3
|
-
//#region src/components/layouts/not-found-page.d.ts
|
|
4
|
-
declare function AdminNotFoundPage(): react_jsx_runtime248.JSX.Element;
|
|
5
|
-
declare function NotFoundPage(): react_jsx_runtime248.JSX.Element;
|
|
6
|
-
//#endregion
|
|
7
|
-
export { AdminNotFoundPage, NotFoundPage };
|
|
8
|
-
//# sourceMappingURL=not-found-page.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"not-found-page.d.mts","names":[],"sources":["../../../src/components/layouts/not-found-page.tsx"],"sourcesContent":[],"mappings":";;;iBAEgB,iBAAA,CAAA,GAAiB,oBAAA,CAAA,GAAA,CAAA;iBAQjB,YAAA,CAAA,GAAY,oBAAA,CAAA,GAAA,CAAA"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { NotFoundSection } from "./not-found-section.mjs";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
|
|
4
|
-
//#region src/components/layouts/not-found-page.tsx
|
|
5
|
-
function AdminNotFoundPage() {
|
|
6
|
-
return /* @__PURE__ */ jsx("div", {
|
|
7
|
-
className: "relative z-0 grid h-[100dvh] w-full place-items-center",
|
|
8
|
-
children: /* @__PURE__ */ jsx(NotFoundSection, { href: "/admin" })
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
function NotFoundPage() {
|
|
12
|
-
return /* @__PURE__ */ jsx("div", {
|
|
13
|
-
className: "relative z-0 grid h-[100dvh] w-full place-items-center",
|
|
14
|
-
children: /* @__PURE__ */ jsx(NotFoundSection, {})
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
//#endregion
|
|
19
|
-
export { AdminNotFoundPage, NotFoundPage };
|
|
20
|
-
//# sourceMappingURL=not-found-page.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"not-found-page.mjs","names":[],"sources":["../../../src/components/layouts/not-found-page.tsx"],"sourcesContent":["import { NotFoundSection } from \"./not-found-section\";\n\nexport function AdminNotFoundPage() {\n return (\n <div className=\"relative z-0 grid h-[100dvh] w-full place-items-center\">\n <NotFoundSection href=\"/admin\" />\n </div>\n );\n}\n\nexport function NotFoundPage() {\n return (\n <div className=\"relative z-0 grid h-[100dvh] w-full place-items-center\">\n <NotFoundSection />\n </div>\n );\n}\n"],"mappings":";;;;AAEA,SAAgB,oBAAoB;AAClC,QACE,oBAAC;EAAI,WAAU;YACb,oBAAC,mBAAgB,MAAK,WAAW;GAC7B;;AAIV,SAAgB,eAAe;AAC7B,QACE,oBAAC;EAAI,WAAU;YACb,oBAAC,oBAAkB;GACf"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { cn } from "../../lib/utils/cn.mjs";
|
|
2
|
-
import { buttonVariants } from "../ui/button.mjs";
|
|
3
|
-
import { HomeIcon } from "lucide-react";
|
|
4
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
-
import Link from "next/link";
|
|
6
|
-
|
|
7
|
-
//#region src/components/layouts/not-found-section.tsx
|
|
8
|
-
function NotFoundSection({ href }) {
|
|
9
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
10
|
-
className: "flex flex-col items-center gap-12 text-center",
|
|
11
|
-
children: [/* @__PURE__ */ jsxs("span", {
|
|
12
|
-
className: "text-foreground space-y-2",
|
|
13
|
-
children: [/* @__PURE__ */ jsx("h2", {
|
|
14
|
-
className: "text-9xl font-bold leading-none",
|
|
15
|
-
children: "404"
|
|
16
|
-
}), /* @__PURE__ */ jsx("h1", {
|
|
17
|
-
className: "text-2xl font-bold lg:text-3xl",
|
|
18
|
-
children: "Oeps, deze pagina is niet gevonden."
|
|
19
|
-
})]
|
|
20
|
-
}), href && /* @__PURE__ */ jsxs(Link, {
|
|
21
|
-
href,
|
|
22
|
-
className: cn(buttonVariants({ variant: "secondary" }), "text-foreground"),
|
|
23
|
-
children: [/* @__PURE__ */ jsx(HomeIcon, { className: "mr-2 size-4" }), "Terug naar home"]
|
|
24
|
-
})]
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
//#endregion
|
|
29
|
-
export { NotFoundSection };
|
|
30
|
-
//# sourceMappingURL=not-found-section.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"not-found-section.mjs","names":[],"sources":["../../../src/components/layouts/not-found-section.tsx"],"sourcesContent":["import { buttonVariants } from \"@/components/ui/button\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { HomeIcon } from \"lucide-react\";\nimport type { Route } from \"next\";\nimport Link from \"next/link\";\n\nexport function NotFoundSection({ href }: { href?: Route }) {\n return (\n <div className=\"flex flex-col items-center gap-12 text-center\">\n <span className=\"text-foreground space-y-2\">\n <h2 className=\"text-9xl font-bold leading-none\">404</h2>\n <h1 className=\"text-2xl font-bold lg:text-3xl\">Oeps, deze pagina is niet gevonden.</h1>\n </span>\n\n {href && (\n <Link\n href={href}\n className={cn(buttonVariants({ variant: \"secondary\" }), \"text-foreground\")}\n >\n <HomeIcon className=\"mr-2 size-4\" />\n Terug naar home\n </Link>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;AAMA,SAAgB,gBAAgB,EAAE,QAA0B;AAC1D,QACE,qBAAC;EAAI,WAAU;aACb,qBAAC;GAAK,WAAU;cACd,oBAAC;IAAG,WAAU;cAAkC;KAAQ,EACxD,oBAAC;IAAG,WAAU;cAAiC;KAAwC;IAClF,EAEN,QACC,qBAAC;GACO;GACN,WAAW,GAAG,eAAe,EAAE,SAAS,aAAa,CAAC,EAAE,kBAAkB;cAE1E,oBAAC,YAAS,WAAU,gBAAgB;IAE/B;GAEL"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { cn } from "@/lib/utils/cn";
|
|
2
|
-
import type { Route } from "next";
|
|
3
|
-
import Link from "next/link";
|
|
4
|
-
import type { HTMLAttributes } from "react";
|
|
5
|
-
import { buttonVariants } from "../ui/button";
|
|
6
|
-
import { EmptyPage, EmptyPageDescription, EmptyPageTitle } from "./empty-page";
|
|
7
|
-
|
|
8
|
-
export type NotAllowedPageProps = HTMLAttributes<HTMLDivElement> & {
|
|
9
|
-
title?: string;
|
|
10
|
-
description?: string;
|
|
11
|
-
callToAction?: {
|
|
12
|
-
href: Route;
|
|
13
|
-
title: string;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export function NotAllowedPage({
|
|
18
|
-
title,
|
|
19
|
-
description,
|
|
20
|
-
callToAction,
|
|
21
|
-
...props
|
|
22
|
-
}: NotAllowedPageProps) {
|
|
23
|
-
return (
|
|
24
|
-
<EmptyPage {...props}>
|
|
25
|
-
<EmptyPageTitle>{title ?? "Geen toegang"}</EmptyPageTitle>
|
|
26
|
-
<EmptyPageDescription>
|
|
27
|
-
{description ?? "Je hebt geen toegang tot deze pagina."}
|
|
28
|
-
</EmptyPageDescription>
|
|
29
|
-
|
|
30
|
-
{callToAction && (
|
|
31
|
-
<Link href={callToAction.href} className={cn(buttonVariants({ variant: "default" }))}>
|
|
32
|
-
{callToAction.title}
|
|
33
|
-
</Link>
|
|
34
|
-
)}
|
|
35
|
-
</EmptyPage>
|
|
36
|
-
);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// <EmptyPage
|
|
40
|
-
// {...props}
|
|
41
|
-
// title={title ?? "Geen toegang"}
|
|
42
|
-
// description={description ?? "Je hebt geen toegang tot deze pagina."}
|
|
43
|
-
// callToAction={callToAction ?? { href: "/admin", title: "Terug naar dashboard" }}
|
|
44
|
-
// />
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { NotFoundSection } from "./not-found-section";
|
|
2
|
-
|
|
3
|
-
export function AdminNotFoundPage() {
|
|
4
|
-
return (
|
|
5
|
-
<div className="relative z-0 grid h-[100dvh] w-full place-items-center">
|
|
6
|
-
<NotFoundSection href="/admin" />
|
|
7
|
-
</div>
|
|
8
|
-
);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export function NotFoundPage() {
|
|
12
|
-
return (
|
|
13
|
-
<div className="relative z-0 grid h-[100dvh] w-full place-items-center">
|
|
14
|
-
<NotFoundSection />
|
|
15
|
-
</div>
|
|
16
|
-
);
|
|
17
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { buttonVariants } from "@/components/ui/button";
|
|
2
|
-
import { cn } from "@/lib/utils/cn";
|
|
3
|
-
import { HomeIcon } from "lucide-react";
|
|
4
|
-
import type { Route } from "next";
|
|
5
|
-
import Link from "next/link";
|
|
6
|
-
|
|
7
|
-
export function NotFoundSection({ href }: { href?: Route }) {
|
|
8
|
-
return (
|
|
9
|
-
<div className="flex flex-col items-center gap-12 text-center">
|
|
10
|
-
<span className="text-foreground space-y-2">
|
|
11
|
-
<h2 className="text-9xl font-bold leading-none">404</h2>
|
|
12
|
-
<h1 className="text-2xl font-bold lg:text-3xl">Oeps, deze pagina is niet gevonden.</h1>
|
|
13
|
-
</span>
|
|
14
|
-
|
|
15
|
-
{href && (
|
|
16
|
-
<Link
|
|
17
|
-
href={href}
|
|
18
|
-
className={cn(buttonVariants({ variant: "secondary" }), "text-foreground")}
|
|
19
|
-
>
|
|
20
|
-
<HomeIcon className="mr-2 size-4" />
|
|
21
|
-
Terug naar home
|
|
22
|
-
</Link>
|
|
23
|
-
)}
|
|
24
|
-
</div>
|
|
25
|
-
);
|
|
26
|
-
}
|