summaryrefslogtreecommitdiffstats
path: root/webapp/components/admin_console/setting.jsx
blob: 8fc5c2ad8b8f98e555ddfe98e19ba6f74a3396ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.

import React from 'react';

export default class Setting extends React.Component {
    render() {
        let marginClass;
        if (this.props.margin === 'small') {
            marginClass = ' form-group--small';
        }

        return (
            <div className={'form-group' + marginClass}>
                <label
                    className='control-label col-sm-4'
                >
                    {this.props.label}
                </label>
                <div className='col-sm-8'>
                    {this.props.children}
                </div>
            </div>
        );
    }
}
Setting.defaultProps = {
};

Setting.propTypes = {
    label: React.PropTypes.node.isRequired,
    children: React.PropTypes.node.isRequired,
    margin: React.PropTypes.oneOf(['', 'small'])
};