import { ArrowDownRightIcon, ArrowUpRightIcon } from 'lucide-react'; import type { FunctionComponent } from 'react'; import { Link } from 'react-router-dom'; import { Card } from '@/common/components/atoms/Card/Card'; import { CardContent } from '@/common/components/atoms/Card/Card.Content'; import { CardHeader } from '@/common/components/atoms/Card/Card.Header'; import { ctw } from '@/common/utils/ctw/ctw'; import { WarningSvg } from '@/common/components/atoms/icons'; import { WarningFilledSvg } from '@ballerine/ui'; type StatsCardProps = { prefix?: string; href?: string; value: number | string; title: string; description: string; className?: string; valueClassName?: string; centered?: boolean; style?: React.CSSProperties; alert?: boolean; tendency?: { value: number | string; direction: 'up' | 'down'; kind: 'positive' | 'negative' | 'neutral'; }; }; export const StatsCard: FunctionComponent = ({ prefix = '', value, title, description, href, centered, tendency, className, style, alert, }) => { const Content = ( <> {title} {tendency && (
{tendency.value} {tendency.direction === 'up' ? ( ) : ( )}
)}
{alert && }

{typeof value === 'number' && value > 0 ? `${prefix}${Intl.NumberFormat('en').format(value)}` : value ?? 0}

{description}

); if (href) { return ( {Content} ); } return ( {Content} ); };