import React from 'react';
import { Input, Form } from '@easyv/antd';

const FormItem = Form.Item;

export default function SocketForm() {
  return (
    <FormItem
      label="Base URL"
      name="baseURL"
      rules={[
        {
          pattern: /^((ws|wss)?:\/\/)[^\s]+/i,
          message: '请输入合法的url地址'
        },
        { required: true, message: '请输入socket地址!', whitespace: true }
      ]}>
      <Input placeholder={'ws[s]://hostname[:port][/pathname]'} />
    </FormItem>
  );
}
