2017-09-04 21:48:56 +00:00
|
|
|
// @flow
|
2020-06-20 20:59:15 +00:00
|
|
|
import { observer } from "mobx-react";
|
2020-08-09 05:53:59 +00:00
|
|
|
import * as React from "react";
|
2020-06-20 20:59:15 +00:00
|
|
|
import styled from "styled-components";
|
2020-08-09 05:53:59 +00:00
|
|
|
import Flex from "components/Flex";
|
2017-09-04 21:48:56 +00:00
|
|
|
|
2021-01-30 05:36:09 +00:00
|
|
|
type Props = {|
|
2018-05-05 23:16:08 +00:00
|
|
|
label: React.Node | string,
|
|
|
|
children: React.Node,
|
2021-01-30 05:36:09 +00:00
|
|
|
|};
|
2017-09-04 21:48:56 +00:00
|
|
|
|
|
|
|
const Labeled = ({ label, children, ...props }: Props) => (
|
|
|
|
<Flex column {...props}>
|
2017-11-08 06:02:07 +00:00
|
|
|
<Label>{label}</Label>
|
2017-09-04 21:48:56 +00:00
|
|
|
{children}
|
|
|
|
</Flex>
|
|
|
|
);
|
|
|
|
|
2017-11-08 06:02:07 +00:00
|
|
|
export const Label = styled(Flex)`
|
2017-09-04 21:48:56 +00:00
|
|
|
font-weight: 500;
|
2021-03-31 04:02:08 +00:00
|
|
|
padding-bottom: 4px;
|
|
|
|
display: inline-block;
|
|
|
|
color: ${(props) => props.theme.text};
|
2017-09-04 21:48:56 +00:00
|
|
|
`;
|
|
|
|
|
|
|
|
export default observer(Labeled);
|