import { useCallback, useState } from 'react' import { useResizeObserver } from '../../../shared/hooks/use-resize-observer' import { useTranslation } from 'react-i18next' import classNames from 'classnames' import { Button } from 'react-bootstrap' import Icon from '../../../shared/components/icon' import PropTypes from 'prop-types' export default function PdfLogEntryRawContent({ rawContent, collapsedSize = 0, }) { const [expanded, setExpanded] = useState(false) const [needsExpander, setNeedsExpander] = useState(false) const { elementRef } = useResizeObserver( useCallback( element => { setNeedsExpander(element.scrollHeight > collapsedSize) }, [collapsedSize] ) ) const { t } = useTranslation() return (
          {rawContent.trim()}
        
{needsExpander && (
)}
) } PdfLogEntryRawContent.propTypes = { rawContent: PropTypes.string.isRequired, collapsedSize: PropTypes.number, }