import React, { forwardRef, ComponentType } from 'react' import { generateStyledSystem } from './generateStyledSystem' import { StyledProps } from '../components/types' import { useTheme } from '@/hooks' type StylePropKeys = 'style' | 'contentContainerStyle' /** * A higher-order function that generates a styled component with styled-system props. * @template P - The props type for the component. * @template R - The ref type for the component. * @param {ComponentType
} component - The component to be styled. * @param {StylePropKeys} [styleProp='style'] - The name of the prop to pass the generated styles to (might be e.g. 'contentContainerStyle' for `ScrollView`). * @returns {FunctionComponent
} A styled component with styled-system props.
* @example
* import { Text } from 'react-native'
* import { generateStyledComponent } from '@/components/utils'
*
* const StyledText = generateStyledComponent(Text)
*
* const Component = () => (
*
( component: ComponentType
,
styleProp: StylePropKeys = 'style'
) =>
forwardRef