Improve `SVG not found` component with category context and update search placeholder

This commit is contained in:
pheralb
2025-09-17 12:03:56 +01:00
parent aeeaacd993
commit 5d45c720b4
3 changed files with 53 additions and 15 deletions
+22 -2
View File
@@ -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();
</script>
<div class="flex w-full flex-col items-center justify-center space-y-4">
<BoxesIcon size={48} strokeWidth={1} />
<p>"{svgTitle}" not found</p>
<h2 class="text-xl font-semibold">SVG not found</h2>
{#if category}
<p class="text-neutral-600 dark:text-neutral-400">
"{svgTitle}" not found in "{category}" category
</p>
{:else}
<p class="text-neutral-600 dark:text-neutral-400">
"{svgTitle}" not found
</p>
{/if}
<div class="flex items-center justify-center space-x-2">
{#if category}
<a
href={`/?search=${svgTitle}`}
class={buttonVariants({ variant: "outline" })}
>
<SearchIcon size={14} strokeWidth={1.5} />
<span>Search globally</span>
</a>
{/if}
<a
target="_blank"
href={globals.requestSvgUrl}