Passed
Push — master ( 912bac...4ae8cd )
by Guangyu
05:25 queued 11s
created

src/components/experience/ExperienceInput.js   A

Complexity

Total Complexity 1
Complexity/F 0

Size

Lines of Code 30
Function Count 0

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 27
mnd 1
bc 1
fnc 0
dl 0
loc 30
rs 10
bpm 0
cpm 0
noi 0
c 0
b 0
f 0
1
import React from 'react';
2
import PropTypes from 'prop-types';
3
import { Col, FormGroup, Input, Label, Row } from 'reactstrap';
4
import Datetime from 'react-datetime';
5
6
const ExperienceInput = ({ id, label, type, ...rest }) => (
7
  <FormGroup className="form-group">
8
    <Row>
9
      <Col lg={3} className="text-lg-right">
10
        <Label className="mb-0" htmlFor={id}>
11
          {label}
12
        </Label>
13
      </Col>
14
      <Col lg={7}>
15
        {type === 'datetime' ? <Datetime id={id} {...rest} /> : <Input bsSize="sm" id={id} type={type} {...rest} />}
16
      </Col>
17
    </Row>
18
  </FormGroup>
19
);
20
21
ExperienceInput.propTypes = {
22
  id: PropTypes.string.isRequired,
23
  label: PropTypes.string.isRequired,
24
  type: PropTypes.string
25
};
26
27
ExperienceInput.defaultProps = { type: 'text' };
28
29
export default ExperienceInput;
30