import { Head, Link, router } from '@inertiajs/react'; import { Ban, Radio, Shield, StopCircle, Undo2 } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { dashboard as adminDashboard } from '@/routes/admin'; import { stop as stopBroadcast } from '@/routes/admin/broadcasts'; import { restore, suspend } from '@/routes/admin/channels'; import { show as showChannel } from '@/routes/channels'; type LiveBroadcast = { id: number; title: string; started_at: string | null; channel: { id: number; slug: string; display_name: string; owner: string; }; }; type AdminChannel = { id: number; slug: string; display_name: string; is_live: boolean; suspended_at: string | null; owner: { id: number; name: string; }; }; type Props = { stats: { users: number; channels: number; live_channels: number; vods: number; }; liveBroadcasts: LiveBroadcast[]; channels: AdminChannel[]; }; export default function AdminDashboard({ stats, liveBroadcasts, channels, }: Props) { return ( <>

Admin

Moderate live streams, channels, users, and recordings.

Live broadcasts

{liveBroadcasts.map((broadcast) => (
{broadcast.title}
{broadcast.channel.display_name} by{' '} {broadcast.channel.owner}
))} {liveBroadcasts.length === 0 && (
No channels are live.
)}

Recent channels

{channels.map((channel) => (
{channel.display_name}
@{channel.slug} owned by{' '} {channel.owner.name}
{channel.suspended_at ? ( ) : ( )}
))}
); } AdminDashboard.layout = { breadcrumbs: [ { title: 'Admin', href: adminDashboard(), }, ], }; function Stat({ label, value }: { label: string; value: number }) { return (
{label}
{value}
); }