|
|
@ -29,16 +29,8 @@ export function calculateWarningStateEntries(entries: [string, any][]) { |
|
|
|
return { length: warninglength, errors } |
|
|
|
return { length: warninglength, errors } |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function determineLength(warningStateEntries: [string, any][]) { |
|
|
|
|
|
|
|
let length = 0 |
|
|
|
|
|
|
|
warningStateEntries.forEach((entry) => { |
|
|
|
|
|
|
|
length += entry[1].filter(x => x.options.type === 'warning').length |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
return length |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export function BasicTitle(props: BasicTitleProps) { |
|
|
|
export function BasicTitle(props: BasicTitleProps) { |
|
|
|
determineLength(props.warningStateEntries) |
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<span>Remix{props.warningStateEntries.length > 0 && !props.hideWarnings ? <i data-id="StaticAnalysisErrorCount" className="badge badge-info rounded-circle ml-1">{calculateWarningStateEntries(props.warningStateEntries).length}</i>: ( |
|
|
|
<span>Remix{props.warningStateEntries.length > 0 && !props.hideWarnings ? <i data-id="StaticAnalysisErrorCount" className="badge badge-info rounded-circle ml-1">{calculateWarningStateEntries(props.warningStateEntries).length}</i>: ( |
|
|
|
<i className="badge badge-info rounded-circle ml-1"> |
|
|
|
<i className="badge badge-info rounded-circle ml-1"> |
|
|
|