import React from 'react';
import {
    Container,
    Segment,
    Form,
    Input,
    Button,
    Checkbox,
    Grid,
    Menu,
    List
} from 'semantic-ui-react';
import ConditionField from './Condition';

const stateDefault = ()=>({
    groups: {
        "g1":{
            name: "aaa"
        },
        "g2":{
            name: "bbb"
        }
    }
})

class ActionLinkAdd extends React.Component {
    state = {
        ...stateDefault()
    }

    render() {
        let {i18n, showDialog, toggleLoading} = this.props;
        return (
            <Container>
                <Menu>
                    <Menu.Menu position="right">
                        <Menu.Item content="ShowTree" onClick={()=>{}}/>
                        <Menu.Item content="Save" onClick={()=>{}}/>
                    </Menu.Menu>
                </Menu>
                <Form as={Segment}>
                    <Form.Field>
                        <Checkbox label="啟用連動" />
                    </Form.Field>
                    <Form.Field>
                        <label>建立條件群組</label>
                        <ConditionField i18n={i18n} showDialog={showDialog} toggleLoading={toggleLoading} groups={this.state.groups} />
                    </Form.Field>
                </Form>
            </Container>
        )
    }
}

export default ActionLinkAdd;