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

28 lines
859 B
Plaintext
Raw Normal View History

2024-10-24 17:05:46 -05:00
---
2024-10-24 17:32:46 -05:00
import type { Avatar } from '../../../components/Gallery/List';
2024-10-24 17:05:46 -05:00
import { PageWrapper } from '../../../components/PageWrapper';
import { galleryTool } from '../../../constants/tools';
2024-10-24 17:32:46 -05:00
import { fetchGlossary } from '../../../core/blitz/fetchGlossary';
2024-10-24 17:05:46 -05: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-24 17:05:46 -05:00
---
<ToolLayout tool={galleryTool}>
2024-10-24 17:32:46 -05:00
<PageWrapper color="gold">
<Page {avatars} client:load />
2024-10-24 17:05:46 -05:00
</PageWrapper>
</ToolLayout>