Files
blitzkit/packages/preforged/tools/gallery/_index.tsx
T

53 lines
1.5 KiB
TypeScript
Raw Normal View History

2025-01-15 20:14:05 -06:00
import { literals } from '@blitzkit/i18n/src/literals';
2024-10-25 10:51:53 -05:00
import { CalendarIcon } from '@radix-ui/react-icons';
2024-10-25 10:49:11 -05:00
import { Callout, Flex } from '@radix-ui/themes';
2024-12-27 12:38:38 -06:00
import { GalleryList, type Avatar } from '../../../../components/Gallery/List';
import { GallerySearch } from '../../../../components/Gallery/Search';
import { PageWrapper } from '../../../../components/PageWrapper';
2025-01-07 13:00:43 -06:00
import {
LocaleProvider,
useLocale,
type LocaleAcceptorProps,
} from '../../../../hooks/useLocale';
2024-12-27 12:38:38 -06:00
import { GalleryEphemeral } from '../../../../stores/galleryEphemeral';
2024-10-24 17:32:46 -05:00
2025-01-07 13:00:43 -06:00
interface ContentProps {
2024-10-24 17:32:46 -05:00
avatars: Avatar[];
2024-10-25 10:49:11 -05:00
lastUpdated: string;
2024-10-24 17:32:46 -05:00
}
2025-01-07 13:00:43 -06:00
type PageProps = ContentProps & LocaleAcceptorProps;
export function Page({ locale, ...props }: PageProps) {
return (
<LocaleProvider locale={locale}>
<Content {...props} />
</LocaleProvider>
);
}
function Content({ avatars, lastUpdated }: ContentProps) {
const { strings } = useLocale();
2024-10-24 17:32:46 -05:00
return (
2024-11-24 20:39:21 -06:00
<PageWrapper maxWidth="80rem" color="gold">
2024-10-25 10:49:11 -05:00
<Flex justify="center">
<Callout.Root size="1">
<Callout.Icon>
2024-10-25 10:51:53 -05:00
<CalendarIcon />
2024-10-25 10:49:11 -05:00
</Callout.Icon>
2025-01-07 13:00:43 -06:00
<Callout.Text>
{literals(strings.website.tools.gallery.last_updated, [
lastUpdated,
])}
</Callout.Text>
2024-10-25 10:49:11 -05:00
</Callout.Root>
</Flex>
2024-10-24 18:21:37 -05:00
<GalleryEphemeral.Provider>
<GallerySearch />
<GalleryList avatars={avatars} />
</GalleryEphemeral.Provider>
</PageWrapper>
2024-10-24 17:32:46 -05:00
);
}