mirror of
https://github.com/anotherhadi/default-creds.git
synced 2026-04-02 11:32:11 +02:00
Svelte 5, renaming
Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com>
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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
10
src/types/result.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
export interface Result {
|
||||
manufacturer: string;
|
||||
name: string;
|
||||
icon: string;
|
||||
tags: string[];
|
||||
version: string;
|
||||
comment: string;
|
||||
user: string;
|
||||
pass: string;
|
||||
}
|
||||
Reference in New Issue
Block a user