import React, { ReactNode } from "react"; import { Text as DefaultText, TextProps } from "react-native"; import useThemeColor from "../useThemeColor"; export default function Text({ text = undefined, size = 16, bold = false, centered = false, italic = false, spaced = false, style, color, margin, marginHorizontal, marginVertical, marginTop, marginRight, marginBottom, marginLeft, numberOfLines = undefined, selectable = true, children = undefined, }: { text?: string; size?: number; bold?: boolean; centered?: boolean; italic?: boolean; spaced?: boolean; style?: TextProps["style"]; color?: string; numberOfLines?: number; margin?: number; marginHorizontal?: number; marginVertical?: number; marginTop?: number; marginRight?: number; marginBottom?: number; marginLeft?: number; selectable?: boolean; children?: ReactNode; }) { const textColor = useThemeColor("text"); if (!text && !children) return null; return ( {text || children} ); }