import React from 'react'
import { View, Text } from '@tarojs/components'

interface MemberBadgeProps {
  levelName?: string
  size?: 'small' | 'normal'
}

const MemberBadge: React.FC<MemberBadgeProps> = ({ levelName, size = 'normal' }) => {
  if (!levelName) return null

  const sizeClass = size === 'small' ? 'text-xs px-1 py-0' : 'text-sm px-2 py-1'

  return (
    <View
      className={`inline-flex items-center rounded-full ${sizeClass}`}
      style={{
        background: 'linear-gradient(135deg, #fbbf24, #f59e0b)',
        color: '#78350f',
      }}
    >
      <Text className='font-medium'>{levelName}</Text>
    </View>
  )
}

export default MemberBadge
