mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-12-06 00:03:50 +01:00
29 lines
707 B
TypeScript
29 lines
707 B
TypeScript
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>
|
||
|
|
);
|
||
|
|
}
|