2017-05-18 21:21:33 +03:00
|
|
|
import React from 'react';
|
|
|
|
import { Subscriber } from 'react-broadcast';
|
|
|
|
import styled from 'styled-components';
|
|
|
|
import remcalc from 'remcalc';
|
|
|
|
import Label from '../label';
|
|
|
|
|
2017-05-25 17:59:58 +03:00
|
|
|
const StyledLabel = Label.extend`
|
2017-05-18 21:21:33 +03:00
|
|
|
margin-right: ${remcalc(12)};
|
|
|
|
`;
|
|
|
|
|
|
|
|
export default props => {
|
|
|
|
const render = value => {
|
|
|
|
const { id = '' } = value || {};
|
|
|
|
return <StyledLabel {...props} htmlFor={id} />;
|
|
|
|
};
|
|
|
|
|
|
|
|
return (
|
|
|
|
<Subscriber channel="input-group">
|
|
|
|
{render}
|
|
|
|
</Subscriber>
|
|
|
|
);
|
|
|
|
};
|