import React from 'react';

import {
  LockOutlined,
  MailOutlined,
  MobileOutlined,
  UserOutlined,
} from '@ant-design/icons';

import styles from './index.less';

export default {
  UserName: {
    props: {
      size: 'large',
      id: 'userName',
      prefix: <UserOutlined className={styles.prefixIcon} />,
      placeholder: 'admin',
    },
    rules: [
      {
        required: true,
        message: 'Please enter username!',
      },
    ],
  },
  NewYearPassword: {
    props: {
      size: 'large',
      prefix: (
        <LockOutlined className={styles.prefixIcon} twoToneColor="#ff9600" />
      ),
      type: 'password',
      id: 'password',
      placeholder: '888888',
    },
    rules: [
      {
        required: true,
        message: 'Please enter password!',
      },
    ],
  },
  Password: {
    props: {
      size: 'large',
      prefix: <LockOutlined className={styles.prefixIcon} />,
      type: 'password',
      id: 'password',
      placeholder: '888888',
    },
    rules: [
      {
        required: true,
        message: 'Please enter password!',
      },
    ],
  },
  Mobile: {
    props: {
      size: 'large',
      prefix: <MobileOutlined className={styles.prefixIcon} />,
      placeholder: 'mobile number',
      id: 'mobile',
    },
    rules: [
      {
        required: true,
        message: '请输入手机号码!',
      },
      {
        pattern: /^0?1([38][0-9]|4[5-9]|5[0-3,5-9]|6[6]|7[0135678]|9[89])\d{8}$/,
        message: '输入手机号码格式错误!',
      },
    ],
  },
  Captcha: {
    props: {
      size: 'large',
      prefix: <MailOutlined className={styles.prefixIcon} />,
      placeholder: '请输入短信验证码',
    },
    rules: [
      {
        required: true,
        message: '请输入短信验证码',
      },
    ],
  },
  NewYearMobile: {
    props: {
      size: 'large',
      prefix: (
        <MobileOutlined className={styles.prefixIcon} twoToneColor="#ff9600" />
      ),
      placeholder: 'mobile number',
      id: 'mobile',
    },
    rules: [
      {
        required: true,
        message: '请输入手机号码!',
      },
      {
        pattern: /^0?1([38][0-9]|4[5-9]|5[0-3,5-9]|6[6]|7[0135678]|9[89])\d{8}$/,
        message: '输入手机号码格式错误!',
      },
    ],
  },
  NewYearCaptcha: {
    props: {
      size: 'large',
      prefix: (
        <MailOutlined className={styles.prefixIcon} twoToneColor="#ff9600" />
      ),
      placeholder: '请输入短信验证码',
    },
    rules: [
      {
        required: true,
        message: '请输入短信验证码',
      },
    ],
  },
};
