import React from 'react'
import { Col, Row, Input, Form, Select, DatePicker, Button } from 'antd'
import commonStyles from '../../../Utils/Common.less'
import TextArea from 'antd/es/input/TextArea'
import { SaveOutlined } from '@ant-design/icons'

const AddTaskImage = (props: any): React.ReactElement => {
    const customizeRequiredMark = (
        label: React.ReactNode,
        { required }: { required: boolean }
    ): React.ReactElement => (
        <>
            {label}
            &nbsp;
            {required && <span className={commonStyles.requireIcon}>*</span>}
        </>
    )

    return (
        <div className={commonStyles.formWrapper}>
            <Form
                name="complex-form"
                labelCol={{ span: 24 }}
                wrapperCol={{ span: 24 }}
                initialValues={{ remember: true }}
                layout={'vertical'}
                autoComplete="off"
                requiredMark={customizeRequiredMark}
            >
                <Row gutter={16}>
                    <Col span={12}>
                        <Form.Item<any>
                            label="Sprint Name"
                            name="clientCategoryId"
                            rules={[
                                {
                                    required: true,
                                    message: 'Please enter the Sprint Name!',
                                },
                            ]}
                        >
                            <Input />
                        </Form.Item>
                    </Col>
                    <Col span={12}>
                        <Form.Item<any>
                            label="Duration"
                            name="clientCategoryId"
                            rules={[
                                {
                                    required: true,
                                    message: 'Please select the Duration!',
                                },
                            ]}
                        >
                            <Select
                                showSearch
                                allowClear
                                placeholder="Please select"
                                onChange={() => {}}
                            />
                        </Form.Item>
                    </Col>
                </Row>
                <Row gutter={16}>
                    <Col span={12}>
                        <Form.Item<any>
                            label="Start date"
                            name="departmentName"
                            rules={[
                                {
                                    required: true,
                                    message: 'Please Select Your Start Date!',
                                },
                            ]}
                        >
                            <DatePicker
                                showTime
                                format="D/M/YYYY"
                                className={commonStyles.dateWidth}
                            />
                        </Form.Item>
                    </Col>
                    <Col span={12}>
                        <Form.Item<any>
                            label="End Date"
                            name="departmentName"
                            rules={[
                                {
                                    required: true,
                                    message: 'Please Select Your End Date!',
                                },
                            ]}
                        >
                            <DatePicker
                                showTime
                                format="D/M/YYYY"
                                className={commonStyles.dateWidth}
                            />
                        </Form.Item>
                    </Col>
                </Row>
                <Row gutter={16}>
                    <Col span={24}>
                        <Form.Item<any> label="Sprint goal" name="description">
                            <TextArea rows={4} />
                        </Form.Item>
                    </Col>
                </Row>
                <Row gutter={16}>
                    <Col offset={22} span={2}>
                        <Button type="primary" htmlType="submit">
                            <SaveOutlined />
                        </Button>
                    </Col>
                </Row>
            </Form>
        </div>
    )
}

export default AddTaskImage
