import { getAllStreamsForVtuber, getStreamCountForVtuber } from "@/lib/streams"; import { getVodsForVtuber } from "@/lib/vods"; import { IVtuber } from "@/lib/vtubers"; export interface IArchiveProgressProps { vtuber: IVtuber; } export default async function ArchiveProgress ({ vtuber }: IArchiveProgressProps) { // // Check if totalStreams is not zero before calculating completedPercentage // const completedPercentage = (totalStreams !== 0) ? Math.round(eligibleStreams / totalStreams * 100) : 0; const goodStreams = await getStreamCountForVtuber(vtuber.id, ['good']) const issueStreams = await getStreamCountForVtuber(vtuber.id, ['issue']) const totalStreams = await getStreamCountForVtuber(vtuber.id) const eligibleStreams = goodStreams+issueStreams const completedPercentage = (eligibleStreams / totalStreams) * 100 return (
{/*

{totalStreams} known streams
{goodStreams} streams archived
{issueStreams} streams with issues

*/}

{eligibleStreams}/{totalStreams} Streams Archived ({completedPercentage}%)

{completedPercentage}%
) // @todo // return ( //
//

{(vods) ? vods.data.length : 0} vods

//
// ) }