mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
30 lines
934 B
Plaintext
30 lines
934 B
Plaintext
---
|
|
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';
|
|
|
|
export { getStaticPaths } from '../../index.astro';
|
|
|
|
const { locale } = Astro.params;
|
|
const glossary = await fetchGlossary(locale);
|
|
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(locale);
|
|
---
|
|
|
|
<ToolLayout tool={galleryTool}>
|
|
<Page {locale} {avatars} {lastUpdated} client:load />
|
|
</ToolLayout>
|