import React from 'react'; import { View } from 'react-native'; import styled from 'styled-components/native'; import { border, color, flexbox, layout, position, space, typography, } from 'styled-system'; import { useThemeProps } from '../../../hooks/useThemeProps'; import Text from './../Text'; import { customBackground, customBorder, customExtra, customLayout, customOutline, customPosition, customShadow, customTypography, } from '../../../utils/customProps'; import type { IBoxProps } from './types'; const StyledBox = styled(View)( color, space, layout, flexbox, border, position, typography, customPosition, customBorder, customBackground, customOutline, customShadow, customExtra, customTypography, customLayout ); const Box = ({ children, _text, ...props }: IBoxProps, ref: any) => { const boxProps = useThemeProps('Box', props); return ( {React.Children.map(children, (child) => typeof child === 'string' ? {child} : child )} ); }; export type { IBoxProps }; export default React.memo(React.forwardRef(Box));