Skip to content

Commit c3c6a14

Browse files
committed
feat: live stream counter on dashboard home lol
1 parent 9b9ce54 commit c3c6a14

File tree

1 file changed

+27
-3
lines changed

1 file changed

+27
-3
lines changed

src/app/dashboard/page.tsx

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,33 @@
1-
import { Title } from '@mantine/core';
1+
import { prisma } from '@/lib/db';
2+
import {
3+
Card,
4+
Center,
5+
Group,
6+
SimpleGrid,
7+
Stack,
8+
Text,
9+
Title,
10+
} from '@mantine/core';
11+
import { IconAccessPoint } from '@tabler/icons-react';
212

313
export default async function DashboardPage() {
14+
const liveStreams = await prisma.stream.count({ where: { state: 'Live' } });
15+
416
return (
5-
<>
17+
<Stack>
618
<Title order={1}>Hello!</Title>
7-
</>
19+
20+
<SimpleGrid cols={{ base: 1, sm: 2, lg: 4 }} spacing="xl">
21+
<Card shadow="sm" withBorder>
22+
<Group>
23+
<Center>
24+
<IconAccessPoint size={40} color="red" />
25+
</Center>
26+
27+
<Title order={2}>Live streams: {liveStreams}</Title>
28+
</Group>
29+
</Card>
30+
</SimpleGrid>
31+
</Stack>
832
);
933
}

0 commit comments

Comments
 (0)