diff --git a/libs/remix-ui/static-analyser/src/lib/components/BasicTabBody.tsx b/libs/remix-ui/static-analyser/src/lib/components/BasicTabBody.tsx index c9625c0b92..eb2a1dc898 100644 --- a/libs/remix-ui/static-analyser/src/lib/components/BasicTabBody.tsx +++ b/libs/remix-ui/static-analyser/src/lib/components/BasicTabBody.tsx @@ -6,78 +6,70 @@ type BasicTabBodyProps = { hideWarnings: boolean showLibsWarning: boolean warningState: any + ssaWarnings: any[] + ssaWarningsNoLibs: any[] startAnalysis: boolean analysisModule: any } -export function BasicTabBody({ state, hideWarnings, showLibsWarning, warningState, startAnalysis, analysisModule}: BasicTabBodyProps) { - +export function BasicTabBody({ state, hideWarnings, ssaWarnings, ssaWarningsNoLibs, showLibsWarning, warningState, startAnalysis, analysisModule}: BasicTabBodyProps) { +const test = ssaWarningsNoLibs.filter(x => x.options.isLibrary === false) +const test1 = ssaWarningsNoLibs.filter(x => x.options.isLibrary) +console.log({test, test1 }) return ( <> - {Object.entries(warningState).length > 0 ? ( -
-
- {Object.entries(warningState).map((warning, index) => ( -
- { hideWarnings === false ? {warning[0]} : null} - { hideWarnings === false ? warning[1]["map"]( - (x,i) => // eslint-disable-line dot-notation - x.hasWarning - ? ( // eslint-disable-next-line dot-notation -
- -
- ) : null) : null} - { - hideWarnings === false ? warning[1]["map"]((x,i) =>( - showLibsWarning === false ? ( - x.isLibrary ? ( -
- -
- ) : null): null)) : null - } - { - hideWarnings === false ? warning[1]["map"]((x,i) =>( -
- -
- )) : null - } + {ssaWarningsNoLibs.length > 0 ? ( +
+
+ { + (hideWarnings === false && showLibsWarning === false) && ssaWarningsNoLibs.length > 0 + ? ssaWarningsNoLibs.filter(x => x.options.isLibrary === false).map((item, index) => ( +
+ +
+ )) + : null + } + { + hideWarnings === false && showLibsWarning === true && ssaWarnings.length > 0 + ? ssaWarnings.map((warning, index) => ( +
+
- ))} -
-
- ) : state.data && state.file.length > 0 && state.source && startAnalysis && Object.entries(warningState).length > 0 ? Loading... : Nothing to report} - - ) + )) : null + } +
+
+ ) : state.data && + state.file.length > 0 && + state.source && + startAnalysis && + Object.entries(warningState).length > 0 ? ( + + Loading... + + ) : ( + Nothing to report + )} + + ); }