import React from 'react'; import cn from 'classnames'; import { getRE } from 'App/utils'; import { Icon, NoContent, Tabs, Input } from 'UI'; import { jump } from 'Player'; import { LEVEL } from 'Types/session/log'; import Autoscroll from '../Autoscroll'; import BottomBlock from '../BottomBlock'; import stl from './console.module.css'; import { Duration } from 'luxon'; const ALL = 'ALL'; const INFO = 'INFO'; const WARNINGS = 'WARNINGS'; const ERRORS = 'ERRORS'; const LEVEL_TAB = { [LEVEL.INFO]: INFO, [LEVEL.LOG]: INFO, [LEVEL.WARNING]: WARNINGS, [LEVEL.ERROR]: ERRORS, [LEVEL.EXCEPTION]: ERRORS, }; const TABS = [ALL, ERRORS, WARNINGS, INFO].map((tab) => ({ text: tab, key: tab })); // eslint-disable-next-line complexity const getIconProps = (level) => { switch (level) { case LEVEL.INFO: case LEVEL.LOG: return { name: 'console/info', color: 'blue2', }; case LEVEL.WARN: case LEVEL.WARNING: return { name: 'console/warning', color: 'red2', }; case LEVEL.ERROR: return { name: 'console/error', color: 'red', }; } return null; }; function renderWithNL(s = '') { if (typeof s !== 'string') return ''; return s.split('\n').map((line, i) =>