/*
 * @Author: zhoux zhouxia@supervision.ltd
 * @Date: 2023-11-15 15:01:34
 * @LastEditors: zhoux zhouxia@supervision.ltd
 * @LastEditTime: 2023-11-22 13:24:58
 * @FilePath: \general-ai-platform-web\src\components\DictionaryBox\isEnable.tsx
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { isEnableEnum } from '@/enums/common';
import { Badge } from 'antd';
import { FormattedMessage } from 'react-intl';

type IsEnableBoxProps = {
  isEnable: boolean;
};

const IsEnableBox: React.FC<IsEnableBoxProps> = (props) => {
  const { isEnable } = props;

  const currentItem = isEnableEnum[isEnable ? '1' : '0']

  return (
    <div style={{ display: 'flex', alignItems: 'center'}}>
      <Badge status={isEnable ? 'success' : 'default'}></Badge>
      <span style={{color: currentItem.color, paddingLeft: 4 }}>
        <FormattedMessage id={isEnable ? 'common.enable' : 'common.disable'} defaultMessage="$$$" />
      </span>
    </div>
  );
};

export default IsEnableBox;
