import { forwardRef } from 'react'; import type { ComponentPropsWithoutRef, ReactNode } from 'react'; import classNames from 'classnames'; import type { OmitUnion } from '@/mastodon/utils/types'; import { Icon } from '../icon'; import type { IconProp } from '../icon'; import classes from './styles.module.css'; export type MiniCardProps = OmitUnion< ComponentPropsWithoutRef<'div'>, { label: ReactNode; value: ReactNode; icon?: IconProp; iconId?: string; iconClassName?: string; } >; export const MiniCard = forwardRef( ( { label, value, className, hidden, icon, iconId, iconClassName, children, ...props }, ref, ) => { if (!label) { return null; } return (
{icon && ( )}
{label}
{value}
{children}
); }, ); MiniCard.displayName = 'MiniCard';