import React from 'react'; import styles from './card.scss'; import { ConfigurableLink } from '@openmrs/esm-framework'; import { useTranslation } from 'react-i18next'; import { ArrowRight } from '@carbon/react/icons'; import classNames from 'classnames'; type CardProps = { title: string | React.ReactNode; total: number | string; onClick?: () => void; categories?: Array<{ label: string; value: number; onClick?: () => void }>; refreshButton?: React.ReactNode; }; const Card: React.FC = ({ title, total, categories, onClick, refreshButton }) => { const { t } = useTranslation(); return (
{title}
{refreshButton &&
{refreshButton}
}
{total}
{categories?.length ? categories.map((category, index) => (
{category.label}
{category.value}
)) : typeof onClick === 'function' && ( {t('view', 'View')} )}
); }; export default Card;