fix: remove unused variables from Svelte components

This commit is contained in:
2026-07-10 11:58:42 +01:00
parent 895d7f0df9
commit eed8814021
30 changed files with 313 additions and 272 deletions
+20 -15
View File
@@ -1284,7 +1284,8 @@
</div>
<Card.Root>
<Card.Content class="space-y-4 pt-6">
{#each Array(5) as _, i (i)}
{#each Array(5) as __, i (i)}
{__}
<Skeleton class="h-12 w-full" />
{/each}
</Card.Content>
@@ -1306,7 +1307,7 @@
'general'
? 'bg-white text-gray-900 shadow-sm'
: 'text-gray-600 hover:text-gray-900'}"
onclick={(_) => (activeTab = 'general')}
onclick={() => (activeTab = 'general')}
>
<svg
class="mx-auto mb-1 h-4 w-4"
@@ -1326,7 +1327,7 @@
'history'
? 'bg-white text-gray-900 shadow-sm'
: 'text-gray-600 hover:text-gray-900'}"
onclick={(_) => (activeTab = 'history')}
onclick={() => (activeTab = 'history')}
>
<svg
class="mx-auto mb-1 h-4 w-4"
@@ -1349,7 +1350,7 @@
'referral'
? 'bg-white text-gray-900 shadow-sm'
: 'text-gray-600 hover:text-gray-900'}"
onclick={(_) => (activeTab = 'referral')}
onclick={() => (activeTab = 'referral')}
>
<svg
class="mx-auto mb-1 h-4 w-4"
@@ -1372,7 +1373,7 @@
'cards'
? 'bg-white text-gray-900 shadow-sm'
: 'text-gray-600 hover:text-gray-900'}"
onclick={(_) => {
onclick={() => {
activeTab = 'cards';
savedCardsStore.fetch();
savedCardsStore.invalidate();
@@ -1397,7 +1398,7 @@
'admin'
? 'bg-white text-gray-900 shadow-sm'
: 'text-gray-600 hover:text-gray-900'}"
onclick={(_) => (activeTab = 'admin')}
onclick={() => (activeTab = 'admin')}
>
<svg
class="mx-auto mb-1 h-4 w-4"
@@ -1517,7 +1518,8 @@
</Dialog.Root>
{#if loadingUser}
{#each Array(6) as _, i (i)}
{#each Array(6) as __, i (i)}
{__}
<Skeleton class="h-12 w-full" />
{/each}
{:else if userData}
@@ -1716,7 +1718,8 @@
</div>
<div class="grid grid-cols-5 gap-3 sm:grid-cols-10">
{#each Array(10) as _, i (i)}
{#each Array(10) as __, i (i)}
{__}
{@const slotNum = i + 1}
{@const rot = ((slotNum * 37 + 13) % 7) - 3}
{#if slotNum <= (stamps > 0 ? stamps % 10 || 10 : 0)}
@@ -1789,7 +1792,8 @@
</Card.Header>
<Card.Content class="space-y-2">
{#if loadingUpcoming}
{#each Array(3) as _, i (i)}
{#each Array(3) as __, i (i)}
{__}
<Skeleton class="h-16 w-full" />
{/each}
{:else}
@@ -1843,7 +1847,8 @@
</Card.Header>
<Card.Content class="space-y-2">
{#if loadingPast}
{#each Array(5) as _, i (i)}
{#each Array(5) as __, i (i)}
{__}
<Skeleton class="h-16 w-full" />
{/each}
{:else if pastBookings.length === 0}
@@ -2733,7 +2738,7 @@
'general'
? 'bg-white text-gray-900 shadow-sm'
: 'text-gray-600 hover:text-gray-900'}"
onclick={(_) => (activeTab = 'general')}
onclick={() => (activeTab = 'general')}
>
<svg
class="mx-auto mb-1 h-4 w-4"
@@ -2754,7 +2759,7 @@
'history'
? 'bg-white text-gray-900 shadow-sm'
: 'text-gray-600 hover:text-gray-900'}"
onclick={(_) => (activeTab = 'history')}
onclick={() => (activeTab = 'history')}
>
<svg
class="mx-auto mb-1 h-4 w-4"
@@ -2778,7 +2783,7 @@
'referral'
? 'bg-white text-gray-900 shadow-sm'
: 'text-gray-600 hover:text-gray-900'}"
onclick={(_) => (activeTab = 'referral')}
onclick={() => (activeTab = 'referral')}
>
<svg
class="mx-auto mb-1 h-4 w-4"
@@ -2802,7 +2807,7 @@
'cards'
? 'bg-white text-gray-900 shadow-sm'
: 'text-gray-600 hover:text-gray-900'}"
onclick={(_) => {
onclick={() => {
activeTab = 'cards';
savedCardsStore.fetch();
savedCardsStore.invalidate();
@@ -2828,7 +2833,7 @@
'admin'
? 'bg-white text-gray-900 shadow-sm'
: 'text-gray-600 hover:text-gray-900'}"
onclick={(_) => (activeTab = 'admin')}
onclick={() => (activeTab = 'admin')}
>
<svg
class="mx-auto mb-1 h-4 w-4"
-4
View File
@@ -69,8 +69,6 @@
settings: 'expanded'
});
let _isMobile = $state(false);
// =============== Lifted Data Fetching ===============
// Fetch shared data once at page level to avoid duplicate API calls
let defaultHours = $state<
@@ -96,10 +94,8 @@
if (!browser) return;
const mql = window.matchMedia('(max-width: 767px)');
_isMobile = mql.matches;
function handleChange(e: MediaQueryListEvent) {
_isMobile = e.matches;
for (const key in sectionState) {
sectionState[key as keyof typeof sectionState] = e.matches ? 'collapsed' : 'expanded';
}
@@ -367,7 +367,8 @@
{#if pageState === 'loading'}
<div class="mx-auto max-w-3xl space-y-4 p-6 pt-24">
<Skeleton class="h-8 w-48" />
{#each Array(5) as _, i (i)}
{#each Array(5) as __, i (i)}
{__}
<Skeleton class="h-24 w-full" />
{/each}
</div>
+2 -1
View File
@@ -62,7 +62,8 @@
{#if servicesLoading}
<div class="space-y-4">
{#each Array(5) as _, i (i)}
{#each Array(5) as __, i (i)}
{__}
<Card.Root class="shadow-sm">
<Card.Content>
<div class="flex items-start justify-between">
+4 -2
View File
@@ -208,7 +208,8 @@
<div class="h-8 w-44 rounded-lg bg-gray-200"></div>
<div class="h-4 w-64 rounded bg-gray-200"></div>
<div class="space-y-4 pt-2">
{#each Array(3) as _, i (i)}
{#each Array(3) as __, i (i)}
{__}
<div class="rounded-xl border bg-white p-5 shadow-sm">
<div class="mb-3 flex items-center gap-3">
<div class="h-4 w-24 rounded bg-gray-200"></div>
@@ -241,7 +242,8 @@
{#if loading}
<div class="space-y-6">
{#each Array(3) as _, i (i)}
{#each Array(3) as __, i (i)}
{__}
<div class="animate-pulse rounded-xl border bg-white p-5 shadow-sm">
<div class="mb-3 flex items-center gap-3">
<div class="h-4 w-24 rounded bg-gray-200"></div>