import React, { ComponentPropsWithoutRef, ReactNode } from 'react' import { Text as RNText, TextStyle, StyleProp } from 'react-native' import { useTextStyle } from '../hooks/use-style' type Props = Omit, 'style'> & { style?: StyleProp children: ReactNode centered?: boolean } const styleProp = (base: TextStyle, added?: StyleProp) => { if (Array.isArray(added)) return [base, ...added] return [base, added] } export const H1 = React.forwardRef(function H1(props, ref) { const { style, children, centered, ...p } = props const textStyle = useTextStyle() return ( {children} ) }) export const Paragraph = React.forwardRef(function Paragraph( props, ref ) { const { style, children, centered, ...p } = props const textStyle = useTextStyle() return ( {children} ) }) export const Text = { H1, Paragraph, }