import * as React from 'react';
import { withRouter, RouteChildrenProps } from 'react-router-dom';
import Collect from './UI.Child.Collect';
import Sublist from './UI.Child.Sublist'
/** Props接口 */
interface IProps {

}

class UIComponents extends React.Component<IProps & RouteChildrenProps, any> {

    constructor(props) {
        super(props);
        this.state = {
            radioValue: 'collect'
        };
    }
    radioChange = (value) => {
        this.setState({
            radioValue: value
        })
    }


    componentDidMount() {
    }


    render() {
        const { radioValue } = this.state;
        return (
            <div style={{ height: 'calc(100vh - 97px)', display: 'flex', flexDirection: 'column' }}>
                {radioValue === 'collect' && <Collect changeView={this.radioChange} />}
                {radioValue === 'sublist' && <Sublist changeView={this.radioChange} />}
            </div>
        );
    }
}

export default withRouter(UIComponents as any)