SPB Git

Repository Public

EmptyState.tsx 1.7 KB 61 lines tsx

1// États vides : illustrations architecturales sobres, tirées du symbole.23import type { ReactNode } from "react";4import { cn } from "@/lib/cn";5import { LoukaSettlingDoor } from "./Door";67type Kind =8  /** porte fermée : aucun résultat */9  | "closed"10  /** porte entrouverte : invitation à explorer */11  | "ajar"12  /** plusieurs portes : les possibilités */13  | "many"14  /** porte et cœur : favoris vides */15  | "heart";1617function Art({ kind }: { kind: Kind }) {18  if (kind === "many") {19    return (20      <div className="flex items-end gap-3.5">21        <LoukaSettlingDoor size={30} angle={0} className="opacity-45" />22        <LoukaSettlingDoor size={42} angle={44} delay={140} />23        <LoukaSettlingDoor size={30} angle={20} delay={300} className="opacity-45" />24      </div>25    );26  }27  return (28    <div className="relative">29      <LoukaSettlingDoor size={46} angle={kind === "closed" ? 0 : 40} />30      {kind === "heart" && (31        <svg viewBox="0 0 24 24" className="absolute -right-5 -top-2 size-6 text-accent" fill="currentColor" aria-hidden>32          <path d="M12 20.500s-7-4.4-7-9.700A3.8 3.8 0 0 1 12 8.600a3.8 3.8 0 0 1 7 2.200c0 5.3-7 9.7-7 9.700Z" />33        </svg>34      )}35    </div>36  );37}3839export function LoukaEmptyState({40  kind = "ajar",41  title,42  text,43  action,44  className,45}: {46  kind?: Kind;47  title: string;48  text?: ReactNode;49  action?: ReactNode;50  className?: string;51}) {52  return (53    <div className={cn("mx-auto flex max-w-sm flex-col items-center px-6 py-14 text-center", className)}>54      <Art kind={kind} />55      <h3 className="mt-7 text-[1.35rem]">{title}</h3>56      {text && <p className="mt-2 text-[0.92rem] leading-relaxed text-ink-3">{text}</p>}57      {action && <div className="mt-6">{action}</div>}58    </div>59  );60}61
Files main
Menu

Theme