import React, { FC } from 'react';
import { TextProps } from 'types';
import * as S from './styles';

export const Text: FC<TextProps> = ({
	block,
	children,
	italic,
	size,
	testId,
	underlined,
	weight,
}) => {
	return (
		// @ts-ignore TODO -> need to figure out how to pass size to as "legally"
		<S.Text
			data-testid={testId}
			as={size}
			{...{ block, italic, size, underlined, weight }}>
			{children}
		</S.Text>
	);
};

Text.defaultProps = { size: 'span', testId: 'text', underlined: false };

export default Text;
