From 731363ed66cfd9926421220a258c7b8c36907e51 Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.me>
Date: Thu, 4 Jan 2024 18:53:23 -0800
Subject: feat: loading and error cards

---
 src/lib/Tools/Schedule/Tool.svelte | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

(limited to 'src/lib/Tools/Schedule/Tool.svelte')

diff --git a/src/lib/Tools/Schedule/Tool.svelte b/src/lib/Tools/Schedule/Tool.svelte
index 349f98d0..bc48e423 100644
--- a/src/lib/Tools/Schedule/Tool.svelte
+++ b/src/lib/Tools/Schedule/Tool.svelte
@@ -15,6 +15,7 @@
 	import { onMouseEnter, onMouseLeave, onMouseMove } from '$lib/Media/Cover/hoverCover';
 	import HoverCover from '$lib/Media/Cover/HoverCover.svelte';
 	import Crunchyroll from '$lib/Tools/Schedule/Crunchyroll.svelte';
+	import Loading from '$lib/Loading.svelte';
 
 	let subsPleasePromise: Promise<SubsPlease>;
 	let scheduledMediaPromise: Promise<Partial<Media[]>>;
@@ -94,11 +95,11 @@
 </blockquote>
 
 {#await subsPleasePromise}
-	Loading subtitle release data ... 49.5%
+	<Loading type="subtitle release data" percent={49.5} />
 {:then subsPlease}
 	{#if subsPlease}
 		{#await scheduledMediaPromise}
-			Loading anime schedule ... 82.5%
+			<Loading type="anime schedule" percent={82.5} />
 		{:then scheduledMedia}
 			{#if scheduledMedia}
 				{@const columnCount = Math.ceil(Object.keys(subsPlease.schedule).length / 2)}
@@ -178,16 +179,16 @@
 					{/each}
 				</div>
 			{:else}
-				Loading anime schedule ... 66%
+				<Loading type="anime schedule" percent={66} />
 			{/if}
 		{:catch}
-			<Error type="Media" loginSessionError={false} />
+			<Error type="Media" loginSessionError={false} card />
 		{/await}
 	{:else}
-		Loading subtitle release data ... 33%
+		<Loading type="subtitle release data" percent={33} />
 	{/if}
 {:catch}
-	<Error type="Schedule" loginSessionError={false} />
+	<Error type="Schedule" loginSessionError={false} card />
 {/await}
 
 <p />
-- 
cgit v1.2.3

