import { ComponentProps, ReactElement } from "react"; import { TextStyle } from "react-native"; import { Body } from "./Body"; export type BodyProps = ComponentProps & { text: string | ReactElement; }; type PropsComposedBody = { body: Array; textAlign?: TextStyle["textAlign"]; }; export const ComposedBodyFromArray = ({ body, textAlign = "center" }: PropsComposedBody) => ( {body.map(({ text, key, ...props }, i) => ( {text} ))} );