feat: flesh out popular tanks

This commit is contained in:
TrèsAbhi committed 2026-03-15 22:37:46 -05:00
1 parent b6c4c4e852
commit 406ad52c8d
10 files changed
+85 -30

No files matched your search

@@ -0,0 +1,9 @@
.tanks {
z-index: 1;
.content {
display: flex;
gap: 2rem;
}
}
@@ -0,0 +1,32 @@
import { api } from "../../core/api/dynamic";
import { useAwait } from "../../hooks/useAwait";
import {
LocaleProvider,
type LocaleAcceptorProps,
} from "../../hooks/useLocale";
import { Scroller } from "../Scroller";
import { TankCard } from "../TankCard";
import styles from "./index.module.css";
export function HomeTanksPopular({ locale }: LocaleAcceptorProps) {
return (
<LocaleProvider locale={locale}>
<Content />
</LocaleProvider>
);
}
function Content() {
const popular = useAwait(() => api.popularTanks(), "popular-tanks");
const trimmed = popular.tanks.slice(0, 32);
return (
<Scroller className={styles.tanks}>
<div className={styles.content}>
{trimmed.map((tank) => (
<TankCard key={tank.id} {...tank} />
))}
</div>
</Scroller>
);
}