Skip to content

Commit 2e8c4da

Browse files
committed
refac
1 parent ff9f761 commit 2e8c4da

1 file changed

Lines changed: 11 additions & 13 deletions

File tree

src/lib/components/common/PDFViewer.svelte

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -195,20 +195,18 @@
195195
</script>
196196

197197
<div class="relative {className}">
198-
<div class="overflow-y-auto h-full" bind:this={outerContainer}>
199-
<div bind:this={sceneElement} class="w-full">
200-
{#if loading}
201-
<div class="flex items-center justify-center h-full">
202-
<Spinner className="size-5" />
203-
</div>
204-
{/if}
205-
206-
{#if error}
207-
<div class="flex items-center justify-center h-full text-sm text-red-500">
208-
{error}
209-
</div>
210-
{/if}
198+
{#if loading}
199+
<div class="absolute inset-0 flex items-center justify-center">
200+
<Spinner className="size-5" />
201+
</div>
202+
{:else if error}
203+
<div class="absolute inset-0 flex items-center justify-center text-sm text-red-500">
204+
{error}
211205
</div>
206+
{/if}
207+
208+
<div class="overflow-y-auto h-full" bind:this={outerContainer}>
209+
<div bind:this={sceneElement} class="w-full"></div>
212210
</div>
213211

214212
{#if !loading && !error && pdfDoc}

0 commit comments

Comments
 (0)