diff --git a/libs/remix-ui/static-analyser/src/lib/components/BasicTitle.tsx b/libs/remix-ui/static-analyser/src/lib/components/BasicTitle.tsx index c76ff84a13..cff7a73eba 100644 --- a/libs/remix-ui/static-analyser/src/lib/components/BasicTitle.tsx +++ b/libs/remix-ui/static-analyser/src/lib/components/BasicTitle.tsx @@ -29,9 +29,24 @@ export function calculateWarningStateEntries(entries: [string, any][]) { 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) { + determineLength(props.warningStateEntries) return ( - Basic{props.warningStateEntries.length > 0 && !props.hideWarnings ? {calculateWarningStateEntries(props.warningStateEntries).length}: null} + Remix{props.warningStateEntries.length > 0 && !props.hideWarnings ? {calculateWarningStateEntries(props.warningStateEntries).length}: ( + + { + calculateWarningStateEntries(props.warningStateEntries).errors.length + } + + )} ) } \ No newline at end of file