Files
blitzkit/packages/website/src/pages/[...locale]/tools/gallery/index.astro
T

26 lines
827 B
Plaintext
Raw Normal View History

2024-10-24 17:05:46 -05:00
---
2024-12-27 12:38:38 -06:00
import type { Avatar } from '../../../../components/Gallery/List';
import { galleryTool } from '../../../../constants/tools';
import { fetchGlossary } from '../../../../core/blitz/fetchGlossary';
2024-12-27 12:59:56 -06:00
import ToolLayout from '../../../../layouts/ToolLayout.astro';
2024-10-24 17:32:46 -05:00
import { Page } from './_index';
2024-10-24 17:05:46 -05:00
2024-10-24 17:32:46 -05:00
const glossary = await fetchGlossary();
const avatars = Object.entries(glossary)
2024-10-24 17:05:46 -05:00
.filter(
([key, value]) =>
key.startsWith('avatar') &&
!key.endsWith('_part') &&
value.image_url !== null,
)
2024-10-24 17:32:46 -05:00
.map(
([key, value]) =>
({ id: key.replace('avatar_', ''), name: value.title }) satisfies Avatar,
)
.sort((a, b) => a.name.localeCompare(b.name));
2024-10-25 10:49:11 -05:00
const lastUpdated = new Date().toLocaleDateString();
2024-10-24 17:05:46 -05:00
---
<ToolLayout tool={galleryTool}>
2024-10-25 10:49:11 -05:00
<Page {avatars} {lastUpdated} client:load />
2024-10-24 17:05:46 -05:00
</ToolLayout>