forge
Explore
Log in

Don't you dare go Hollow

hezarfen_frontend

Clone
★ 0

0 watching0 forksTypeScript5.5 MiB0069847Burak Boduroğlu2 months ago552 commits

empty-inline.tsx27 lines, 1.1 KiBHistoryRawDownload
1import { Show } from "solid-js";
2import { Illustration } from "@/components/ui/illustration";
3import { cn } from "@/lib/cn";
4import type { IllustrationName } from "@/lib/illustrations";
5
6/** Compact empty state for cards, charts and short lists: a small scene plus
7 * one or two lines. The full-panel version is EmptyState. */
8export function EmptyInline(props: {
9 title: string;
10 hint?: string;
11 illustration?: IllustrationName;
12 /** "md" for roomy containers such as a side panel. */
13 size?: "sm" | "md";
14 class?: string;
15}) {
16 return (
17 <div class={cn("flex flex-col items-center justify-center gap-2 px-4 py-5 text-center", props.class)}>
18 <Illustration name={props.illustration ?? "empty"} class={props.size === "md" ? "h-32 w-48" : "h-16 w-24"} />
19 <div>
20 <p class={cn("font-semibold text-foreground/80", props.size === "md" ? "text-sm" : "text-xs")}>{props.title}</p>
21 <Show when={props.hint}>
22 <p class={cn("mt-0.5 text-muted-foreground", props.size === "md" ? "mx-auto max-w-xs text-xs" : "text-[11px]")}>{props.hint}</p>
23 </Show>
24 </div>
25 </div>
26 );
27}