import React from 'react';
import { View } from '@tarojs/components';
import classNames from 'classnames';

interface LabelProps {
  /** 类型 */
  type?:
    | 'default' //红框红字
    | 'red' //红底白字
    | 'gold' //橙色白字
    | 'green'; //绿色白字
  /** 文案 */
  name: string;
}

/**
 * 标签组件
 */
const Label: React.FC<LabelProps> = ({ name, type = 'default' }) => {
  const classObject = classNames('wm-label', `wm-label-${type}`);

  return (
    <View className={classObject}>
      <View className='text'>{name}</View>
    </View>
  );
};

export default Label;
