All files / src/components/pages/user/profile/profile-description-badge index.tsx

100% Statements 35/35
33.33% Branches 1/3
100% Functions 1/1
100% Lines 35/35

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 361x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x  
import { Icon, IconId } from '@/components/icon';
import { cn } from '@/lib/utils';
 
export interface ProfileDescriptionBadgeProps {
  label: string;
  iconId: IconId;
  value: string;
}
 
interface Props {
  badgeItems: ProfileDescriptionBadgeProps;
}
 
export const ProfileDescriptionBadge = ({ badgeItems }: Props) => {
  const PLACEHOLDER = '-';
 
  return (
    <div className='flex flex-row items-center gap-4'>
      <div className='flex-center size-10 rounded-xl bg-gray-100'>
        <Icon id={badgeItems.iconId} className='text-mint-500 size-6' />
      </div>
      <div className='flex flex-col'>
        <span className='text-text-xs-medium text-gray-500'>{badgeItems.label}</span>
        <span
          className={cn(
            'text-text-md-semibold h-6 text-gray-700',
            !badgeItems.value && 'text-text-md-regular text-gray-500',
          )}
        >
          {badgeItems.value || PLACEHOLDER}
        </span>
      </div>
    </div>
  );
};