web/OmniboxIcon: refactor to svelte 5 style

This commit is contained in:
wukko 2025-05-23 20:17:37 +06:00
parent e73942200b
commit 34b51745fa
No known key found for this signature in database
GPG Key ID: 3E30B3F26C7B4AA2

View File

@ -2,8 +2,13 @@
import IconLink from "@tabler/icons-svelte/IconLink.svelte"; import IconLink from "@tabler/icons-svelte/IconLink.svelte";
import IconLoader2 from "@tabler/icons-svelte/IconLoader2.svelte"; import IconLoader2 from "@tabler/icons-svelte/IconLoader2.svelte";
export let loading: boolean; type Props = {
export let animated = !!loading; loading: boolean;
};
let { loading }: Props = $props();
let animated = $state(loading);
/* /*
initial spinner state is equal to loading state, initial spinner state is equal to loading state,
@ -29,12 +34,8 @@
<div <div
class="input-icon spinner-icon" class="input-icon spinner-icon"
class:animated class:animated
on:transitionstart={() => { ontransitionstart={() => (animated = true)}
animated = true; ontransitionend={() => (animated = loading)}
}}
on:transitionend={() => {
animated = !!loading;
}}
> >
<IconLoader2 /> <IconLoader2 />
</div> </div>