import React, { useState } from 'react' import { Collapse } from 'react-bootstrap' import { formatUnixtime } from '@/utils' import { CopyLogButton } from './CopyLogButton' type DescriptionProps = { description: string | number | Record wordBreak?: boolean } const Description: React.FC = (props) => { const { description } = props if (description === undefined) { return null } if (typeof description !== 'object') { return (
{description}
) } return (
          {JSON.stringify(description, null, 2)}
        
) } type Props = { timestamp: number | null title: string description: string | number | Record defaultShow?: boolean label?: JSX.Element | null wordBreak?: boolean } export const Message: React.FC = (props) => { const { defaultShow, description, title, timestamp, label } = props const [show, setShow] = useState(defaultShow === undefined ? false : defaultShow) const ariaControls = timestamp ? title + timestamp : title const disabled = description === undefined return (
) }