import styled from '@emotion/native';
import { Text } from 'react-native';
import type { TypographyColorIntent } from '../types';

const StyledLabel = styled(Text)<{
  themeIntent: TypographyColorIntent;
  themeIsItalic?: boolean;
  themeFontWeight?: 'regular' | 'medium';
}>(({ themeIntent, theme, themeIsItalic, themeFontWeight = 'regular' }) => {
  const fontFamily = themeIsItalic
    ? theme.__hd__.typography.fonts.neutral[`${themeFontWeight}Italic`]
    : theme.__hd__.typography.fonts.neutral[themeFontWeight];

  return {
    fontSize: theme.__hd__.typography.fontSizes.label,
    lineHeight: theme.__hd__.typography.lineHeights.label,
    letterSpacing: 0,
    color: theme.__hd__.typography.colors[themeIntent],
    fontFamily,
  };
});

export { StyledLabel };
