fp/packages/next/app/components/archive-progress.tsx

32 lines
1.3 KiB
TypeScript
Raw Normal View History

2024-01-20 16:16:14 +00:00
import { getAllStreamsForVtuber } from "@/lib/streams";
2024-03-14 22:08:49 +00:00
import { getVodsForVtuber } from "@/lib/vods";
2024-01-20 16:16:14 +00:00
import { IVtuber } from "@/lib/vtubers";
export interface IArchiveProgressProps {
vtuber: IVtuber;
}
export default async function ArchiveProgress ({ vtuber }: IArchiveProgressProps) {
2024-03-14 22:08:49 +00:00
const vods = await getVodsForVtuber(vtuber.id)
2024-02-27 15:52:43 +00:00
// const streams = await getAllStreamsForVtuber(vtuber.id);
// const goodStreams = await getAllStreamsForVtuber(vtuber.id, ['good']);
// const issueStreams = await getAllStreamsForVtuber(vtuber.id, ['issue']);
// const totalStreams = streams.length;
// const eligibleStreams = issueStreams.length+goodStreams.length;
2024-01-20 16:16:14 +00:00
2024-02-27 15:52:43 +00:00
// // Check if totalStreams is not zero before calculating completedPercentage
// const completedPercentage = (totalStreams !== 0) ? Math.round(eligibleStreams / totalStreams * 100) : 0;
// return (
// <div>
// <p className="heading">{eligibleStreams}/{totalStreams} Streams Archived ({completedPercentage}%)</p>
// <progress className="progress is-success" value={eligibleStreams} max={totalStreams}>{completedPercentage}%</progress>
// </div>
// )
2024-03-14 22:08:49 +00:00
// @todo
return (
<div>
<i><p className="">{(vods) ? vods.data.length : 0} vods</p></i>
</div>
)
2024-01-20 16:16:14 +00:00
}