import React from 'react';
import { Form, Input } from 'antd';
import type { FormInstance } from 'antd';

interface ParamsFormProps {
  form: FormInstance;
}

const ParamsForm: React.FC<ParamsFormProps> = ({ form }) => {
  return (
    <Form form={form} layout="vertical">
      <Form.Item
        label="参数名称"
        name="name"
        rules={[
          { required: true, message: '请输入参数名称' },
          { whitespace: true, message: '不能只输入空格' },
        ]}
      >
        <Input placeholder="请输入参数名称" />
      </Form.Item>
      <Form.Item
        label="参数键"
        name="key"
        rules={[
          { required: true, message: '请输入参数键' },
          { whitespace: true, message: '不能只输入空格' },
        ]}
      >
        <Input placeholder="请输入参数键" />
      </Form.Item>
      <Form.Item
        label="参数值"
        name="value"
        rules={[
          { required: true, message: '请输入参数值' },
          { whitespace: true, message: '不能只输入空格' },
        ]}
      >
        <Input.TextArea rows={5} placeholder="请输入参数值" />
      </Form.Item>
      <Form.Item label="参数说明" name="desc">
        <Input placeholder="请输入参数说明" />
      </Form.Item>
    </Form>
  );
};

export default ParamsForm;
