import React, { useState, useEffect } from 'react';

export default function RichText(props) {
    const [text, setText] = useState('')

    useEffect(() => {
        console.log(props.url,'props.urlprops.url')
        if (props.url) {
            fetch(props.url, { method: 'GET' }).then((response) => {
                return response.text();
            }).then((res) => {
                setText(res)
            })
        }

    }, [props.url])

    return   <div className="text" style={{ wordBreak: 'break-all' }} dangerouslySetInnerHTML={{ __html: text }}></div>

}