import { type ReactNode, useState } from "react"; import { cn } from "@/lib/utils"; import { DEFAULT_MESSAGES, type PlaceholderVariant } from "./messages"; import TileSpriteStrip from "./TileSpriteStrip"; import { pickTileSprite } from "./tileSprites"; interface PlaceholderProps { variant: PlaceholderVariant; message?: string; children?: ReactNode; className?: string; } const DISPLAY_SCALE = 2; const Placeholder = ({ variant, message, children, className }: PlaceholderProps) => { const [sprite] = useState(pickTileSprite); const resolvedMessage = message ?? DEFAULT_MESSAGES[variant]; const isLoading = variant === "loading"; return (

{resolvedMessage}

{children &&
{children}
}
); }; export default Placeholder;