// src/components/MemberBadge.js
import React from 'react';
import { Badge } from './ui/badge';
import { getTierForMember } from '../utils/member-tiers';
import { getTierIcon } from '../config/memberTierIcons';

const MemberBadge = ({ memberSince, tiers }) => {
  const tier = getTierForMember(memberSince, tiers);
  const Icon = getTierIcon(tier.iconKey);

  return (
    <Badge className={`px-3 py-2 rounded-md text-sm flex items-center gap-2 border hover:text-white ${tier.badgeClass}`}>
      <Icon className="size-4" />
      {tier.label}
    </Badge>
  );
};

export default MemberBadge;