summaryrefslogtreecommitdiffstats
path: root/webapp/components/admin_console/setting.jsx
blob: 024111fa5b337514606572b8cd6326fbd49c5c07 (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() {
        return (
            <div className='form-group'>
                <label
                    className='control-label col-sm-4'
                    htmlFor={this.props.inputId}
                >
                    {this.props.label}
                </label>
                <div className='col-sm-8'>
                    {this.props.children}
                    <div className='help-text'>
                        {this.props.helpText}
                    </div>
                </div>
            </div>
        );
    }
}
Setting.defaultProps = {
};

Setting.propTypes = {
    inputId: React.PropTypes.string,
    label: React.PropTypes.node.isRequired,
    children: React.PropTypes.node.isRequired,
    helpText: React.PropTypes.node
};