From 5d45c720b463ce18f521dca4d468aa38e0847573 Mon Sep 17 00:00:00 2001 From: pheralb Date: Wed, 17 Sep 2025 12:03:56 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Improve=20``SVG=20not=20found``=20c?= =?UTF-8?q?omponent=20with=20category=20context=20and=20update=20search=20?= =?UTF-8?q?placeholder?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/svgs/svgNotFound.svelte | 24 +++++++++++- src/routes/+page.svelte | 40 ++++++++++++++------ src/routes/directory/[category]/+page.svelte | 4 +- 3 files changed, 53 insertions(+), 15 deletions(-) diff --git a/src/components/svgs/svgNotFound.svelte b/src/components/svgs/svgNotFound.svelte index 9f28895..81d3764 100644 --- a/src/components/svgs/svgNotFound.svelte +++ b/src/components/svgs/svgNotFound.svelte @@ -2,20 +2,40 @@ import { globals } from "@/globals"; import { buttonVariants } from "@/components/ui/button"; + import SearchIcon from "@lucide/svelte/icons/search"; import ArrowUpRight from "@lucide/svelte/icons/arrow-up-right"; import BoxesIcon from "@/components/ui/moving-icons/boxes-icon.svelte"; interface Props { svgTitle: string; + category?: string; } - let { svgTitle }: Props = $props(); + let { svgTitle, category }: Props = $props();
-

"{svgTitle}" not found

+

SVG not found

+ {#if category} +

+ "{svgTitle}" not found in "{category}" category +

+ {:else} +

+ "{svgTitle}" not found +

+ {/if}
+ {#if category} + + + Search globally + + {/if} {/if}
- { - sorted = value; - searchSvgs(); - }} - /> +
+ { + sorted = value; + searchSvgs(); + }} + /> + {#if showAll && filteredSvgs.length > maxDisplay} + + {/if} +
@@ -120,11 +133,16 @@ {/each} - {#if showAll === false && filteredSvgs.length > maxDisplay} + {#if !showAll && filteredSvgs.length > maxDisplay}
-