mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-01-15 15:48:05 +00:00
Signed-off-by: Lance Chant <13349722+lancechant@users.noreply.github.com> Co-authored-by: sarendsen <coding-mosses0z@icloud.com> Co-authored-by: Lance Chant <13349722+lancechant@users.noreply.github.com> Co-authored-by: Gauvain <68083474+Gauvino@users.noreply.github.com>
37 lines
1.1 KiB
TypeScript
37 lines
1.1 KiB
TypeScript
import { t } from "i18next";
|
|
import { View, type ViewProps } from "react-native";
|
|
import { Text } from "@/components/common/Text";
|
|
import { useDownload } from "@/providers/DownloadProvider";
|
|
import { JobStatus } from "@/providers/Downloads/types";
|
|
import { DownloadCard } from "./DownloadCard";
|
|
|
|
interface ActiveDownloadsProps extends ViewProps {}
|
|
|
|
export default function ActiveDownloads({ ...props }: ActiveDownloadsProps) {
|
|
const { processes } = useDownload();
|
|
if (processes?.length === 0)
|
|
return (
|
|
<View {...props} className='bg-neutral-900 p-4 rounded-2xl'>
|
|
<Text className='text-lg font-bold'>
|
|
{t("home.downloads.active_download")}
|
|
</Text>
|
|
<Text className='opacity-50'>
|
|
{t("home.downloads.no_active_downloads")}
|
|
</Text>
|
|
</View>
|
|
);
|
|
|
|
return (
|
|
<View {...props} className='bg-neutral-900 p-4 rounded-2xl'>
|
|
<Text className='text-lg font-bold mb-2'>
|
|
{t("home.downloads.active_downloads")}
|
|
</Text>
|
|
<View className='gap-y-2'>
|
|
{processes?.map((p: JobStatus) => (
|
|
<DownloadCard key={p.item.Id} process={p} />
|
|
))}
|
|
</View>
|
|
</View>
|
|
);
|
|
}
|