How to trim rich text

How can I trim the length of rich text returned from the API?

Here is my code to get the rich text:

const articleEntries = await contentfulClient.getEntries({
    limit: 5,
    content_type: 'article'

Here is my code to render the rich text:

import { documentToReactComponents } from '@contentful/rich-text-react-renderer'

export default function ArticleComponent({ item }) {
    return (