import { StyleSheet, Text } from 'react-native'; import { useColors, useMotionActive, usePrefersReducedMotion, } from '../../../theme'; import { ShimmerTextRun } from './ShimmerTextRun'; import type { ShimmerTextProps } from './types'; export function ShimmerText({ children, active = true, style, ...props }: ShimmerTextProps) { const colors = useColors(); const reducedMotion = usePrefersReducedMotion(); const playing = useMotionActive(); const color = StyleSheet.flatten(style)?.color ?? colors.foreground; return ( {active && !reducedMotion && children && typeof color === 'string' ? ( ) : ( children )} ); }