Hey is a decentralized and permissionless social media app built with Lens Protocol 🌿

feat: add variants for EmptyState (#5885)

authored by yoginth.com and committed by

GitHub 5a069c1e 62eb9dd0

+12 -7
+12 -7
apps/web/src/components/Shared/UI/EmptyState.tsx
··· 1 + import { cva } from "class-variance-authority"; 1 2 import { memo, type ReactNode } from "react"; 2 3 import { Card } from "@/components/Shared/UI"; 3 - import cn from "@/helpers/cn"; 4 4 5 5 interface EmptyStateProps { 6 6 hideCard?: boolean; ··· 9 9 className?: string; 10 10 } 11 11 12 + const emptyStateVariants = cva("", { 13 + defaultVariants: { hideCard: false }, 14 + variants: { 15 + hideCard: { 16 + false: "", 17 + true: "!bg-transparent !shadow-none !border-0" 18 + } 19 + } 20 + }); 21 + 12 22 const EmptyState = ({ 13 23 hideCard = false, 14 24 icon, ··· 16 26 className = "" 17 27 }: EmptyStateProps) => { 18 28 return ( 19 - <Card 20 - className={cn( 21 - { "!bg-transparent !shadow-none !border-0": hideCard }, 22 - className 23 - )} 24 - > 29 + <Card className={emptyStateVariants({ className, hideCard })}> 25 30 <div className="grid justify-items-center space-y-2 p-5"> 26 31 <div>{icon}</div> 27 32 <div>{message}</div>