import React, { useState, useCallback } from 'react'; import clsx from 'clsx'; import { Button } from '../Button'; import { XrplArrowInternalLinkIcon } from '../Icons'; export interface CardImageProps { /** Image source URL */ image: string; /** Alt text for the image */ imageAlt: string; /** Card title (1 line only) */ title: string; /** Card subtitle (max 3 lines). `\n` renders as a line break; an all-bullet subtitle renders as a list. */ subtitle: string; /** Button label text */ buttonLabel: string; /** Link destination (renders card as clickable link) */ href?: string; /** Click handler for the button */ onClick?: () => void; /** Disabled state */ disabled?: boolean; /** Optional className for custom styling */ className?: string; /** When true, image fills entire container with object-fit: cover (no visible background) */ fullBleed?: boolean; /** Custom background color for image container (defaults to gray-100) */ backgroundColor?: string; } // Matches a leading bullet marker on a subtitle line, e.g. "\u2022 ", "- ", "* ". const BULLET_MARKER = /^\s*[\u2022\u2023\u25E6\u2043\-*]\s+/; /** * Renders the subtitle. * * When every line of the subtitle is a bullet (`\n`-separated), it renders as a * real `