Svelte 5, renaming

Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com>
This commit is contained in:
Hadi
2026-03-17 00:09:32 +01:00
parent 909d61525a
commit 34b1820e51
5 changed files with 20 additions and 16 deletions

View File

@@ -1,13 +1,16 @@
<script lang="ts">
import { Menu } from "lucide-svelte";
import type { Snippet } from "svelte";
import type { NavItem } from "../types/nav";
let {
title = "",
navLinks = [],
action,
}: {
title?: string;
navLinks?: NavItem[];
action?: Snippet;
} = $props();
</script>
@@ -53,7 +56,8 @@
<li>
<a href={sublink.href} class="flex items-center gap-2">
{#if sublink.icon}
<svelte:component this={sublink.icon} size={16} />
{@const Icon = sublink.icon}
<Icon size={16} />
{/if}
{sublink.label}
</a>
@@ -64,7 +68,8 @@
{:else}
<a href={link.href} class="flex items-center gap-2">
{#if link.icon}
<svelte:component this={link.icon} size={18} />
{@const Icon = link.icon}
<Icon size={18} />
{/if}
{link.label}
</a>
@@ -75,7 +80,7 @@
</div>
<div class="navbar-end">
<slot name="action"></slot>
{@render action?.()}
</div>
</div>
</div>

View File

@@ -1,6 +1,6 @@
<script lang="ts">
import { User, Lock, Check, MessageCircle } from "lucide-svelte";
import type { Result } from "src/types/nav";
import type { Result } from "src/types/result";
let { result }: { result: Result} = $props();

View File

@@ -1,7 +1,7 @@
<script lang="ts">
import { onMount } from "svelte";
import Result from "./Result.svelte";
import type { Result as ResultType } from "src/types/nav";
import type { Result as ResultType } from "src/types/result";
import { Search } from "lucide-svelte";
import DefaultView from "./DefaultView.svelte";
import NotFoundView from "./NotFoundView.svelte";

View File

@@ -4,14 +4,3 @@ export interface NavItem {
icon?: any;
children?: NavItem[];
}
export interface Result {
manufacturer: string;
name: string;
icon: string;
tags: string[];
version: string;
comment: string;
user: string;
pass: string;
}

10
src/types/result.ts Normal file
View File

@@ -0,0 +1,10 @@
export interface Result {
manufacturer: string;
name: string;
icon: string;
tags: string[];
version: string;
comment: string;
user: string;
pass: string;
}