chore(web): migration svelte 5 syntax ()

This commit is contained in:
Alex 2024-11-14 08:43:25 -06:00 committed by GitHub
parent 9203a61709
commit 0b3742cf13
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
310 changed files with 6435 additions and 4176 deletions
web/src/lib/components/user-settings-page

View file

@ -19,11 +19,15 @@
import { dialogController } from '$lib/components/shared-components/dialog/dialog';
import { t } from 'svelte-i18n';
export let keys: ApiKeyResponseDto[];
interface Props {
keys: ApiKeyResponseDto[];
}
let newKey: { name: string } | null = null;
let editKey: ApiKeyResponseDto | null = null;
let secret = '';
let { keys = $bindable() }: Props = $props();
let newKey: { name: string } | null = $state(null);
let editKey: ApiKeyResponseDto | null = $state(null);
let secret = $state('');
const format: Intl.DateTimeFormatOptions = {
month: 'short',
@ -118,7 +122,7 @@
<section class="my-4">
<div class="flex flex-col gap-2" in:fade={{ duration: 500 }}>
<div class="mb-2 flex justify-end">
<Button size="sm" on:click={() => (newKey = { name: $t('api_key') })}>{$t('new_api_key')}</Button>
<Button size="sm" onclick={() => (newKey = { name: $t('api_key') })}>{$t('new_api_key')}</Button>
</div>
{#if keys.length > 0}
@ -152,14 +156,14 @@
icon={mdiPencilOutline}
title={$t('edit_key')}
size="16"
on:click={() => (editKey = key)}
onclick={() => (editKey = key)}
/>
<CircleIconButton
color="primary"
icon={mdiTrashCanOutline}
title={$t('delete_key')}
size="16"
on:click={() => handleDelete(key)}
onclick={() => handleDelete(key)}
/>
</td>
</tr>