// @flow /* eslint-disable max-len */ import React from 'react'; import styled from 'styled-components'; import type { ElementProps } from 'react'; import theme from '../theme'; export type Props = { ...ElementProps<'p'>, value: string, isBold?: boolean, color?: string, className?: string, size?: string | number, align?: string, }; const Text = styled.p` font-family: ${(props: PropsWithTheme) => props.theme.fontFamily}; font-size: ${(props: PropsWithTheme) => String(props.size)}; color: ${(props: PropsWithTheme) => props.color || props.theme.colors.text}; margin: 0; padding: 0; font-weight: ${(props: PropsWithTheme) => String(props.isBold ? props.theme.fontWeight.bold : props.theme.fontWeight.default)}; text-align: ${(props: PropsWithTheme) => props.align || 'left'}; `; export const TextComponent = ({ value, isBold, color, className, size, align, id, }: Props) => ( {value} ); TextComponent.defaultProps = { className: '', isBold: false, color: theme.colors.text, size: theme.fontSize.regular, align: 'left', };