import React, {Component, PropTypes} from 'react';

import {
    Row,
    Col,
    Form,
    Input,
    Button,
    Checkbox,
    Select,
    message,
    Tabs,
    Cascader,
    Radio,
    Upload,
    Icon,
    Modal,
    DatePicker,
    Table,
    Spin
} from 'antd';


export default class PublishForm extends Component {
    constructor(props, content) {
        super(props, content);
    }

    handlePublish(e) {
        e.preventDefault();
        const data = {
            id: this.props.product.id,
            status: 1
        };
        this.props.dispatch({
            type: 'UPDATE_PRODUCT',
            data
        });
    }


    render() {
        return (
            <div style={{textAlign:'center'}}>
                <h1>请确认产品各项信息已经填写完整!</h1>
                <Button type="primary" loading={this.props.loading} onClick={this.handlePublish.bind(this)}>
                    <Icon type="solution"/>创建
                </Button>
            </div>
        );
    }

}
