feat: popular categories

This commit is contained in:
2024-05-15 15:07:10 +01:00
parent daa687957e
commit 2bc996d981
14 changed files with 237 additions and 29 deletions

View File

@ -0,0 +1,17 @@
import { useCategoryZaps } from "@/hooks/category-zaps";
import Pill from "../pill";
import { Icon } from "../icon";
import { formatSatsCompact } from "@/number";
export function CategoryZaps({ gameId }: { gameId: string }) {
const zaps = useCategoryZaps(gameId);
const total = zaps.reduce((acc, v) => (acc += v.amount), 0);
return (
<Pill className="flex gap-2">
<Icon name="zap-filled" />
{formatSatsCompact(total)}
</Pill>
);
}