import React from 'react'; import type { ReactNode } from 'react'; import type { TextProps as NativeTextProps, StyleProp, TextStyle, } from 'react-native'; import { StyledCaption } from './StyledCaption'; import type { TypographyIntent } from '../types'; import { pickAccessibilityProps } from '../utils'; import GradientText from '../GradientText'; export interface CaptionProps extends NativeTextProps { /** * Text content. */ children: ReactNode; /** * Font weight of the text. */ fontWeight?: 'regular' | 'medium' | 'semi-bold'; /** * Visual intent color to apply to the text. */ intent?: TypographyIntent; /** * Additional style. */ style?: StyleProp; /** * Testing id of the component. */ testID?: string; /** * Font style to apply to the text. */ fontStyle?: 'normal' | 'italic'; } const Caption = ({ children, fontWeight = 'regular', intent = 'body', allowFontScaling = false, fontStyle = 'normal', style, testID, ...nativeProps }: CaptionProps) => { const isAi = intent === 'ai'; const styledText = ( {children} ); if (isAi) { return ( {styledText} ); } return styledText; }; export default Caption;