import React from "react"; import { Avatar, Button, Card, Chip } from "@sparkle/components/"; import { TruncatedText } from "@sparkle/components/TruncatedText"; import { PlusIcon } from "@sparkle/icons/app/"; import { cn } from "@sparkle/lib/utils"; const FADE_TRANSITION_CLASSES = "s-transition-opacity s-duration-300 s-ease-in-out"; export interface ActionCardProps { icon: React.ComponentType; iconBackgroundColor?: string; iconColor?: string; label: string; description: string | React.ReactNode; isSelected: boolean; canAdd: boolean; cantAddReason?: string; footer?: { label: string; onClick: () => void }; onClick?: () => void; className?: string; cardContainerClassName?: string; mountPortal?: boolean; mountPortalContainer?: HTMLElement; descriptionLineClamp?: number; } export const ActionCard = React.forwardRef( ( { icon, iconBackgroundColor, iconColor, label, description, isSelected, canAdd, cantAddReason, footer, onClick, className, cardContainerClassName, mountPortal, mountPortalContainer, descriptionLineClamp = 2, }, ref ) => { return (
{label} {isSelected && ( )}
{canAdd && (
{description}
{footer && (
{ e.stopPropagation(); footer.onClick(); }} className="s-heading-sm s-cursor-pointer s-text-muted-foreground hover:s-text-highlight-light hover:s-underline hover:s-underline-offset-2 dark:s-text-muted-foreground-night dark:hover:s-text-highlight-light-night" > {footer.label}
)}
); } ); ActionCard.displayName = "ActionCard";