import React from 'react';
import { Text as RNText } from 'react-native';
import type { TextProps } from './type';
import { TextTheme, FontSize, FontWeight } from './theme';

export const Text: React.FC<TextProps> = ({
  style,
  theme = 'standard',
  size = '14',
  weight = '400',
  testID = 'default',
  ...props
}) => {
  return (
    <RNText
      style={[
        TextTheme.common,
        TextTheme[theme],
        FontSize[size],
        FontWeight[weight],
        style,
      ]}
      testID={`hcds-mobile-text-${testID}`}
      {...props}
    >
      {props.children}
    </RNText>
  );
};
