Skip to content

Commit 75f13f0

Browse files
feat: use a spinner (#874)
1 parent 4a2f160 commit 75f13f0

3 files changed

Lines changed: 32 additions & 1 deletion

File tree

src/frontend/src/lib/components/FileViewerOverlay.svelte

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<script lang="ts">
22
import { Button } from '$lib/components/ui/button';
3+
import { Spinner } from '$lib/components/ui/spinner';
34
import { Download, Link, Check, ArrowLeft, Copy } from '@lucide/svelte';
45
import { fade } from 'svelte/transition';
56
import CodeViewer from '$lib/components/CodeViewer.svelte';
@@ -340,7 +341,10 @@
340341
{#if isHeic}
341342
{#if heicConverting && !heicConvertedUrl}
342343
<div class="flex h-full items-center justify-center text-xs text-white/60">
343-
Converting HEIC to PNG...
344+
<div class="flex items-center gap-2">
345+
<Spinner class="size-4" />
346+
<span>Converting HEIC to PNG...</span>
347+
</div>
344348
</div>
345349
{:else if heicConvertedUrl}
346350
<div class="flex h-full items-center justify-center">
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as Spinner } from './spinner.svelte';
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<script lang="ts">
2+
import { cn } from '$lib/utils.js';
3+
import Loader2Icon from '@lucide/svelte/icons/loader-2';
4+
import type { SVGAttributes } from 'svelte/elements';
5+
6+
let {
7+
class: className,
8+
role = 'status',
9+
// we add name, color, and stroke for compatibility with different icon libraries props
10+
name,
11+
color,
12+
stroke,
13+
'aria-label': ariaLabel = 'Loading',
14+
...restProps
15+
}: SVGAttributes<SVGSVGElement> = $props();
16+
</script>
17+
18+
<Loader2Icon
19+
{role}
20+
name={name === null ? undefined : name}
21+
color={color === null ? undefined : color}
22+
stroke={stroke === null ? undefined : stroke}
23+
aria-label={ariaLabel}
24+
class={cn('size-4 animate-spin', className)}
25+
{...restProps}
26+
/>

0 commit comments

Comments
 (0)