"use strict";

import React from 'react';
import ApCheckbox from '../../lib/ap_checkbox';

module.exports = React.createClass({
    getInitialState() {
        return {
            checked: 'foo02'
        };
    },
    handleChange(e) {
        let s = this;
        s.setState({
            checked: e.target.value
        });
    },
    render() {
        let s = this,
            state = s.state;
        return (
            <div>
                <ApCheckbox onChange={s.handleChange}
                            name="foo"
                            id="foo-02"
                            checked={state.checked === 'foo01'}
                            title="This is foo 01"
                            value={"foo01"}></ApCheckbox>
                <ApCheckbox onChange={s.handleChange}
                            name="foo"
                            id="foo-01"
                            checked={state.checked === 'foo02'}
                            title="This is foo 02"
                            value={"foo02"}></ApCheckbox>
            </div>
        );
    }
});


