import React, { useState } from 'react'; import cn from 'classnames'; import { Icon } from 'UI'; import JumpButton from 'Shared/DevTools/JumpButton'; import stl from '../console.module.css'; interface Props { log: any; iconProps: any; jump?: any; renderWithNL?: any; style?: any; } function ConsoleRow(props: Props) { const { log, iconProps, jump, renderWithNL, style } = props; const [expanded, setExpanded] = useState(false); const lines = log.value.split('\n').filter((l: any) => !!l); const canExpand = lines.length > 1; return (
setExpanded(!expanded)} >
{/*
{Duration.fromMillis(log.time).toFormat('mm:ss.SSS')}
*/}
{canExpand && ( )} {renderWithNL(lines.pop())}
{/* {canExpand && expanded && lines.map((l: any, i: number) =>
{l}
)} */}
jump(log.time)} />
); } export default ConsoleRow;