@terrafirmagreg-team/kit 1.2.7 → 1.2.8
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@terrafirmagreg-team/kit",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Fumadocs content engine",
|
|
6
6
|
"license": "LGPL-3.0-only",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@terrafirmagreg-team/mdx": "^1.2.3",
|
|
29
29
|
"@terrafirmagreg-team/sites": "^1.2.1",
|
|
30
30
|
"@terrafirmagreg-team/translate": "^1.2.4",
|
|
31
|
-
"@terrafirmagreg-team/ui": "^1.2.
|
|
31
|
+
"@terrafirmagreg-team/ui": "^1.2.6",
|
|
32
32
|
"fumadocs-core": "16.17.10",
|
|
33
33
|
"lucide-react": "^1.63.0",
|
|
34
34
|
"server-only": "^0.0.1",
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { FileQuestion } from 'lucide-react';
|
|
3
|
+
import { sectionUrl } from '@terrafirmagreg-team/sites/location';
|
|
4
|
+
import { useTranslations } from '@terrafirmagreg-team/translate/hooks/use-translations';
|
|
5
|
+
import { LangLink } from '@terrafirmagreg-team/ui/components/blocks/lang/link';
|
|
6
|
+
import { EmptyState } from '@terrafirmagreg-team/ui/components/blocks/page/empty-state';
|
|
7
|
+
import type { SectionDataset, SectionKey } from '@terrafirmagreg-team/kit/types';
|
|
8
|
+
|
|
9
|
+
export function SectionNotFound({
|
|
10
|
+
section,
|
|
11
|
+
datasets,
|
|
12
|
+
}: {
|
|
13
|
+
section: SectionKey;
|
|
14
|
+
datasets: readonly SectionDataset[];
|
|
15
|
+
}) {
|
|
16
|
+
const t = useTranslations();
|
|
17
|
+
if (!datasets.length)
|
|
18
|
+
return (
|
|
19
|
+
<EmptyState variant="missing">
|
|
20
|
+
{t('Section data is temporarily unavailable. Try again later.', {
|
|
21
|
+
note: 'kit.section_unavailable',
|
|
22
|
+
})}
|
|
23
|
+
</EmptyState>
|
|
24
|
+
);
|
|
25
|
+
return (
|
|
26
|
+
<main className="flex min-h-dvh flex-col items-center justify-center gap-3 p-8 text-muted-foreground">
|
|
27
|
+
<FileQuestion className="size-10" />
|
|
28
|
+
<p>{t('Page not found', { note: 'ui.not_found' })}</p>
|
|
29
|
+
<LangLink
|
|
30
|
+
href={sectionUrl(section, datasets[0].id)}
|
|
31
|
+
className="text-sm underline underline-offset-4 transition-colors hover:text-foreground"
|
|
32
|
+
>
|
|
33
|
+
{t('Back', { note: 'ui.back' })}
|
|
34
|
+
</LangLink>
|
|
35
|
+
</main>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
@@ -5,6 +5,7 @@ import type * as PageTree from 'fumadocs-core/page-tree';
|
|
|
5
5
|
import { flattenTree } from 'fumadocs-core/page-tree';
|
|
6
6
|
import { LangRedirect } from '@terrafirmagreg-team/ui/components/blocks/lang/redirect';
|
|
7
7
|
import { LangContentSwitch } from '@terrafirmagreg-team/ui/components/blocks/lang/content';
|
|
8
|
+
import { SectionNotFound } from '@terrafirmagreg-team/kit/components/views/not-found';
|
|
8
9
|
import {
|
|
9
10
|
renderSectionView,
|
|
10
11
|
renderSectionWorkspace,
|
|
@@ -104,6 +105,13 @@ export function createSectionRedirect(section: SectionKey) {
|
|
|
104
105
|
};
|
|
105
106
|
}
|
|
106
107
|
|
|
108
|
+
export function createSectionNotFound(section: SectionKey) {
|
|
109
|
+
return async function NotFound() {
|
|
110
|
+
const datasets = await sectionDatasets(section);
|
|
111
|
+
return <SectionNotFound section={section} datasets={datasets} />;
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
|
|
107
115
|
export function createSectionRoutes<
|
|
108
116
|
S extends SectionKey,
|
|
109
117
|
TSource = SectionSource,
|