import { Form, Input, InputNumber, Select } from "antd";
import React from "react";
import { FANQIEPAGETYPE, PAGETYPE } from "../../const";


/**
 * 页面链接
 * @returns 
 */
const PagePromoLinkCreateDTO: React.FC<BOOKLINK.BookLinkChildProps> = ({ restField, name }) => {


    return <>
        <Form.Item
            {...restField}
            name={[name, 'pagePromoLinkCreateDTO', 'pageType']}
            label={<strong>页面类型</strong>}
            rules={[{ required: true, message: '请选择页面类型!' }]}
        >
            <Select
                showSearch
                placeholder="页面类型"
                filterOption={(input, option) =>
                    ((option?.label ?? '') as string).toLowerCase().includes(input.toLowerCase())
                }
                allowClear
                options={Object.keys(FANQIEPAGETYPE).map(key => ({ label: FANQIEPAGETYPE[key], value: key }))}
            />
        </Form.Item>
    </>
}

export default React.memo(PagePromoLinkCreateDTO);