import React, { forwardRef } from 'react';
import PropTypes from 'prop-types';
import VtxBaseModal from '../vtx-base-modal';
import BaseContent from './base';
import ThrowContent from './throw';
import CollectContent from './collect';
import './style';
const TABS_BASE = 'community-base';
const TABS_THROW = 'community-throw';
const TABS_COLLECT = 'community-collect';

const VtxCommunityModal = forwardRef(props => {
    const { id, visible, onCancel } = props;
    return (
        <VtxBaseModal
            title={props.name || '生活小区'}
            // subTitle="456"
            visible={visible}
            onCancel={onCancel}
            tabs={[
                { key: TABS_BASE, value: '基础信息' },
                { key: TABS_THROW, value: '投放信息' },
                { key: TABS_COLLECT, value: '收运信息' },
            ]}
            contents={[
                { key: TABS_BASE, content: <BaseContent id={id} /> },
                { key: TABS_THROW, content: <ThrowContent id={id} /> },
                { key: TABS_COLLECT, content: <CollectContent id={id} /> },
            ]}
        />
    );
});

VtxCommunityModal.propTypes = {
    id: PropTypes.string,
    name: PropTypes.string,
    visible: PropTypes.bool,
    onCancel: PropTypes.func,
};
export default VtxCommunityModal;
