film-exif/src/components/FormBlock.js

27 lines
428 B
JavaScript
Raw Normal View History

2018-04-03 22:27:41 -04:00
import {
Col,
FormGroup,
Input,
Label,
} from './Bootstrap';
export const FormBlock = ({
children,
label,
2018-04-04 11:21:38 -04:00
type = 'text',
2018-04-03 22:27:41 -04:00
...props
}) => {
const formElement = (children !== undefined)
? children
2018-04-04 11:21:38 -04:00
: <Input id={props.name} name={props.name} type={type} {...props} />;
2018-04-03 22:27:41 -04:00
return (
<Col xs={12} sm={6} md={3}>
<FormGroup>
2018-04-04 11:21:38 -04:00
<Label for={props.name}>{label}</Label>
2018-04-03 22:27:41 -04:00
{formElement}
</FormGroup>
</Col>
);
};