|
|
|
@ -1,4 +1,4 @@ |
|
|
|
|
import React from 'react' |
|
|
|
|
import React, { useEffect } from 'react' |
|
|
|
|
import { ErrorRendererOptions } from '../../staticanalyser' |
|
|
|
|
|
|
|
|
|
type BasicTitleProps = { |
|
|
|
@ -31,14 +31,18 @@ export function calculateWarningStateEntries(entries: [string, any][]) { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export function BasicTitle(props: BasicTitleProps) { |
|
|
|
|
const[warningCount, setWarningCount] = React.useState(props.warningStateEntries.length) |
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
|
|
|
|
|
}, [props.warningStateEntries.length]) |
|
|
|
|
return ( |
|
|
|
|
<span>Remix{props.warningStateEntries.length > 0 ? !props.hideWarnings ? props.showLibsWarnings ? <i data-id="StaticAnalysisErrorCount" className={`badge ${calculateWarningStateEntries(props.warningStateEntries).length > 0 ? 'badge-warning' : 'badge-danger'} rounded-circle ml-1 text-center`}> |
|
|
|
|
<span>Remix{props.warningStateEntries.length > 0 ? !props.hideWarnings ? !props.showLibsWarnings ? <i data-id="StaticAnalysisErrorCount" className={`badge ${calculateWarningStateEntries(props.warningStateEntries).length > 0 ? 'badge-warning' : 'badge-danger'} rounded-circle ml-1 text-center`}> |
|
|
|
|
{ |
|
|
|
|
calculateWarningStateEntries(props.warningStateEntries).length}</i>: ( |
|
|
|
|
<i className="badge badge-warning rounded-circle ml-1 text-center"> |
|
|
|
|
{ |
|
|
|
|
calculateWarningStateEntries(props.warningStateEntries).length |
|
|
|
|
warningCount |
|
|
|
|
} |
|
|
|
|
</i> |
|
|
|
|
) : null : null} |
|
|
|
|