feat: move to locale

This commit is contained in:
tresabhi committed 2024-12-27 12:38:38 -06:00
1 parent 60ab845326
commit 1843eb3bcf
44 files changed
+234 -223

No files matched your search

@@ -0,0 +1,26 @@
---
import type { Avatar } from '../../../../components/Gallery/List';
import { galleryTool } from '../../../../constants/tools';
import { fetchGlossary } from '../../../../core/blitz/fetchGlossary';
import ToolLayout from '../../../layouts/ToolLayout.astro';
import { Page } from './_index';
const glossary = await fetchGlossary();
const avatars = Object.entries(glossary)
.filter(
([key, value]) =>
key.startsWith('avatar') &&
!key.endsWith('_part') &&
value.image_url !== null,
)
.map(
([key, value]) =>
({ id: key.replace('avatar_', ''), name: value.title }) satisfies Avatar,
)
.sort((a, b) => a.name.localeCompare(b.name));
const lastUpdated = new Date().toLocaleDateString();
---
<ToolLayout tool={galleryTool}>
<Page {avatars} {lastUpdated} client:load />
</ToolLayout>