mirror of
https://github.com/sussy-code/smov.git
synced 2024-12-20 14:37:43 +01:00
Create WarningPart for in-player use
This commit is contained in:
parent
9fc7f0579f
commit
44740aed6a
2 changed files with 17 additions and 11 deletions
|
@ -9,7 +9,6 @@ import {
|
||||||
scrapePartsToProviderMetric,
|
scrapePartsToProviderMetric,
|
||||||
useReportProviders,
|
useReportProviders,
|
||||||
} from "@/backend/helpers/report";
|
} from "@/backend/helpers/report";
|
||||||
import { Icon, Icons } from "@/components/Icon";
|
|
||||||
import { Loading } from "@/components/layout/Loading";
|
import { Loading } from "@/components/layout/Loading";
|
||||||
import {
|
import {
|
||||||
ScrapeCard,
|
ScrapeCard,
|
||||||
|
@ -21,7 +20,8 @@ import {
|
||||||
useListCenter,
|
useListCenter,
|
||||||
useScrape,
|
useScrape,
|
||||||
} from "@/hooks/useProviderScrape";
|
} from "@/hooks/useProviderScrape";
|
||||||
import { LargeTextPart } from "@/pages/parts/util/LargeTextPart";
|
|
||||||
|
import { WarningPart } from "../util/WarningPart";
|
||||||
|
|
||||||
export interface ScrapingProps {
|
export interface ScrapingProps {
|
||||||
media: ScrapeMedia;
|
media: ScrapeMedia;
|
||||||
|
@ -88,15 +88,7 @@ export function ScrapingPart(props: ScrapingProps) {
|
||||||
currentProviderIndex = sourceOrder.length - 1;
|
currentProviderIndex = sourceOrder.length - 1;
|
||||||
|
|
||||||
if (failedStartScrape)
|
if (failedStartScrape)
|
||||||
return (
|
return <WarningPart>{t("player.turnstile.error")}</WarningPart>;
|
||||||
<LargeTextPart
|
|
||||||
iconSlot={
|
|
||||||
<Icon className="text-type-danger text-2xl" icon={Icons.WARNING} />
|
|
||||||
}
|
|
||||||
>
|
|
||||||
{t("player.turnstile.error")}
|
|
||||||
</LargeTextPart>
|
|
||||||
);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
|
|
14
src/pages/parts/util/WarningPart.tsx
Normal file
14
src/pages/parts/util/WarningPart.tsx
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
import { Icon, Icons } from "@/components/Icon";
|
||||||
|
import { BlurEllipsis } from "@/pages/layouts/SubPageLayout";
|
||||||
|
|
||||||
|
export function WarningPart(props: { children: React.ReactNode }) {
|
||||||
|
return (
|
||||||
|
<div className="flex flex-col justify-center items-center h-screen text-center font-medium">
|
||||||
|
<BlurEllipsis />
|
||||||
|
<Icon className="text-type-danger text-2xl" icon={Icons.WARNING} />
|
||||||
|
<div className="max-w-[19rem] mt-3 mb-12 text-type-secondary">
|
||||||
|
{props.children}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
Loading…
Reference in a new issue