mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-12-05 15:52:55 +01:00
feat: string hooks
This commit is contained in:
1 parent
f5f3f70e35
commit
27abf1b0de
7 files changed
+82
-12
No files matched your search
@@ -1,12 +1,25 @@
|
||||
import { AvatarCard } from "../../../components/AvatarCard";
|
||||
import { api } from "../../../core/api/dynamic";
|
||||
import { useAwait } from "../../../hooks/useAwait";
|
||||
import { LocaleProvider } from "../../../hooks/useLocale";
|
||||
|
||||
interface Props {
|
||||
interface PageProps extends ContentProps {
|
||||
locale: string;
|
||||
}
|
||||
|
||||
export function Page({ locale, ...props }: PageProps) {
|
||||
return (
|
||||
<LocaleProvider locale={locale}>
|
||||
<Content {...props} />
|
||||
</LocaleProvider>
|
||||
);
|
||||
}
|
||||
|
||||
interface ContentProps {
|
||||
skeleton?: boolean;
|
||||
}
|
||||
|
||||
export function Page({ skeleton }: Props) {
|
||||
function Content({ skeleton }: ContentProps) {
|
||||
const { avatars } = useAwait(() => api.avatars(), "avatars");
|
||||
|
||||
return (
|
||||
|
||||
@@ -18,8 +18,8 @@ const { locale } = Astro.props;
|
||||
|
||||
<BaseLayout {locale} accent="gold">
|
||||
<Section>
|
||||
<Page client:only="react">
|
||||
<Page skeleton slot="fallback" />
|
||||
<Page {locale} client:only="react">
|
||||
<Page {locale} skeleton slot="fallback" />
|
||||
</Page>
|
||||
</Section>
|
||||
</BaseLayout>
|
||||
Reference in new issue
Block a user