import Markdown from 'react-markdown' import { formatMm } from 'shared/utils' export const Error = ({err}) => (
    {err.stack.split(/\n/g).slice(0, 5).map((l, i) => ( 0 ? ' break-all' : '')}>{l}))}
  
) // Markdown wrapper to suppress creation of P tags const Md = ({ children }) => props.children }}>{children} const Event = ({ evt, units }) => { if (Array.isArray(evt)) { if (evt[1]?.mm) return ${formatMm(evt[1].mm, units, 'html')}` }}/> else return evt.map(e => ) } else if (evt.message) return else if (typeof evt === 'string') return {evt} return Note a recognized event: {JSON.stringify(evt, null ,2)} } export const EventGroup = ({ type='info', events=[], units='metric' }) => events.length > 0 ? (

{type}

{events.map((evt, i) => ( ))}
# Message
{i}
) : null const order = [ 'error', 'warning', 'info', 'debug' ] const Events = props => props?.draft?.events ? (
    {order.map(type => (props.draft.events[type].length > 0) ? (
  • {type} {type === 'debug' ? '' : |}
  • ) : (
  • {type} {type === 'debug' ? '' : |}
  • ) )}
{order.map(type => )}
) : null export default Events