1
0
mirror of https://github.com/yldio/copilot.git synced 2024-09-21 22:03:54 +03:00
copilot/packages/ui-toolkit/src/form/label.js

23 lines
486 B
JavaScript
Raw Normal View History

import React from 'react';
import { Subscriber } from 'react-broadcast';
import styled from 'styled-components';
import remcalc from 'remcalc';
import Label from '../label';
const StyledLabel = styled(Label)`
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>
);
};