mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-12-05 15:52:55 +01:00
1 parent
bc0004574a
commit
2bae132d18
7 files changed
+61
-14
No files matched your search
@@ -0,0 +1,29 @@
|
||||
import { TankCard } from "../../../components/TankCard";
|
||||
import { TankCards } from "../../../components/TankCards";
|
||||
import { api } from "../../../core/api/dynamic";
|
||||
import { useAwait } from "../../../hooks/useAwait";
|
||||
import { LocaleProvider } from "../../../hooks/useLocale";
|
||||
|
||||
interface PageProps {
|
||||
locale: string;
|
||||
}
|
||||
|
||||
export function Page({ locale, ...props }: PageProps) {
|
||||
return (
|
||||
<LocaleProvider locale={locale}>
|
||||
<Content {...props} />
|
||||
</LocaleProvider>
|
||||
);
|
||||
}
|
||||
|
||||
function Content() {
|
||||
const tankList = useAwait(() => api.tankList(), "tank-list");
|
||||
|
||||
return (
|
||||
<TankCards>
|
||||
{tankList.list.map(({ id }) => (
|
||||
<TankCard key={id} id={id} />
|
||||
))}
|
||||
</TankCards>
|
||||
);
|
||||
}
|
||||
@@ -1,9 +1,11 @@
|
||||
---
|
||||
import "@radix-ui/colors/violet-dark.css";
|
||||
import { Section } from "../../../components/Section";
|
||||
import ToolBanner from "../../../components/ToolBanner.astro";
|
||||
import { api } from "../../../core/api/dynamic";
|
||||
import { tools } from "../../../core/tools/tools";
|
||||
import BaseLayout from "../../../layouts/BaseLayout.astro";
|
||||
import { Page } from "./_index";
|
||||
|
||||
export { getStaticPaths } from "../index.astro";
|
||||
|
||||
@@ -14,16 +16,11 @@ const tankList = await api.tankList();
|
||||
<BaseLayout {locale} accent="purple">
|
||||
<ToolBanner {locale} tool={tools.tanks} slot="pre-app" />
|
||||
|
||||
<h1>tanks</h1>
|
||||
<Section>
|
||||
<Page {locale} client:load />
|
||||
</Section>
|
||||
|
||||
{
|
||||
tankList.list.map(({ id, slug }) => (
|
||||
<p>
|
||||
<a href={`/tanks/${slug}`}>
|
||||
<img height="128" width="128" src={`/api/tanks/${id}.webp`} />
|
||||
{slug} ({id})
|
||||
</a>
|
||||
</p>
|
||||
))
|
||||
}
|
||||
<!-- {
|
||||
|
||||
} -->
|
||||
</BaseLayout>
|
||||
Reference in new issue
Block a user