import React, { memo, useState, useEffect } from 'react'; import PropTypes from 'prop-types'; import cx from 'classnames'; import { useStoreState, useActions } from 'm/store'; import { getClashAPIConfig } from 'd/app'; import Icon from 'c/Icon'; import { FixedSizeList as List, areEqual } from 'react-window'; import ContentHeader from 'c/ContentHeader'; import useRemainingViewPortHeight from '../hooks/useRemainingViewPortHeight'; // TODO move this into a redux action import { fetchLogs } from '../api/logs'; import { getLogsForDisplay, appendLog } from 'd/logs'; import yacd from 's/yacd.svg'; import s0 from 'c/Logs.module.scss'; const paddingBottom = 30; const colors = { debug: 'none', // debug: '#8a8a8a', info: '#454545', // info: '#147d14', warning: '#b99105', error: '#c11c1c' }; function LogLine({ time, even, payload, type }) { const className = cx({ even }, s0.log); return (