chore(web): migration svelte 5 syntax (#13883)

This commit is contained in:
Alex
2024-11-14 08:43:25 -06:00
committed by GitHub
parent 9203a61709
commit 0b3742cf13
310 changed files with 6435 additions and 4176 deletions

View File

@@ -8,15 +8,19 @@
import MenuOption from '../../shared-components/context-menu/menu-option.svelte';
import { getAssetControlContext } from '../asset-select-control-bar.svelte';
export let onLink: OnLink;
export let onUnlink: OnUnlink;
export let menuItem = false;
export let unlink = false;
interface Props {
onLink: OnLink;
onUnlink: OnUnlink;
menuItem?: boolean;
unlink?: boolean;
}
let loading = false;
let { onLink, onUnlink, menuItem = false, unlink = false }: Props = $props();
$: text = unlink ? $t('unlink_motion_video') : $t('link_motion_video');
$: icon = unlink ? mdiLinkOff : mdiMotionPlayOutline;
let loading = $state(false);
let text = $derived(unlink ? $t('unlink_motion_video') : $t('link_motion_video'));
let icon = $derived(unlink ? mdiLinkOff : mdiMotionPlayOutline);
const { clearSelect, getOwnedAssets } = getAssetControlContext();
@@ -68,8 +72,8 @@
{#if !menuItem}
{#if loading}
<CircleIconButton title={$t('loading')} icon={mdiTimerSand} />
<CircleIconButton title={$t('loading')} icon={mdiTimerSand} onclick={() => {}} />
{:else}
<CircleIconButton title={text} {icon} on:click={onClick} />
<CircleIconButton title={text} {icon} onclick={onClick} />
{/if}
{/if}