import type { ReactNode } from "react"; import React from "react"; import { MaterialCommunityIcons, MaterialIcons } from "@expo/vector-icons"; import { Text, useTheme, View } from "tamagui"; export interface ScrapeItemProps { status: "failure" | "pending" | "notfound" | "success" | "waiting"; name: string; id?: string; percentage?: number; children?: ReactNode; } export interface ScrapeCardProps extends ScrapeItemProps { hasChildren?: boolean; } const statusTextMap: Partial> = { notfound: "Doesn't have the video", failure: "Failed to scrape", pending: "Checking for videos...", }; const mapPercentageToIcon = (percentage: number) => { const slice = Math.floor(percentage / 12.5); return `circle-slice-${slice === 0 ? 1 : slice}`; }; export function StatusCircle({ type, percentage, }: { type: ScrapeItemProps["status"]; percentage: number; }) { const theme = useTheme(); return ( <> {type === "waiting" && ( )} {type === "pending" && ( )} {type === "failure" && ( )} {type === "notfound" && ( )} {type === "success" && ( )} ); } export function ScrapeItem(props: ScrapeItemProps) { const text = statusTextMap[props.status]; return ( {props.name} {text && {text}} {props.children} ); } export function ScrapeCard(props: ScrapeCardProps) { return ( ); }