import type { FC } from 'react' ; import { serializeComponent } from 'syntx' ; export const serializeComponentToText = ( Component , props ) => { return serializeComponent ( Component , props , { indent : 2 } ) . reduce ( ( result , line ) => { const lineString = line . elements . reduce ( ( lineResult , { value } ) => lineResult + value , '' ) ; return `${ result }${ lineString }\n` ; } , '' ) ; } ;