import React from 'react'; import PropTypes from 'prop-types'; import cx from 'clsx'; import { connect } from './StateProvider'; // import { useStoreState, useActions } from '../misc/store'; import SvgYacd from './SvgYacd'; import { FixedSizeList as List, areEqual } from 'react-window'; import ContentHeader from './ContentHeader'; import useRemainingViewPortHeight from '../hooks/useRemainingViewPortHeight'; import { fetchLogs } from '../api/logs'; import LogSearch from './LogSearch'; import { getLogsForDisplay, appendLog } from '../store/logs'; import { getClashAPIConfig } from '../store/app'; import { getLogLevel } from '../store/configs'; import s0 from './Logs.module.css'; const { useCallback, memo, useEffect } = React; 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 (