hezarfen_frontend
Clone
https://git.tahinli.com/archive/hezarfen_frontend.git
0 watching0 forksTypeScript5.5 MiB0069847Burak Boduroğlu2 months ago552 commits
| 1 | import { Show } from "solid-js"; |
| 2 | import { Illustration } from "@/components/ui/illustration"; |
| 3 | import { cn } from "@/lib/cn"; |
| 4 | import 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. */ |
| 8 | export 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 | } |