@@ -4,6 +4,7 @@ import { KeyboardArrowRight } from "@mui/icons-material";
44import ReactMarkdown from "react-markdown" ;
55import remarkGfm from "remark-gfm" ;
66import { Grid } from "@mui/system" ;
7+ import standardsData from "/src/data/standards.json" ;
78
89const getStatusColor = ( status ) => {
910 switch ( status ?. toLowerCase ( ) ) {
@@ -46,6 +47,23 @@ const getImpactColor = (impact) => {
4647 }
4748} ;
4849
50+ const checkCIPPStandardAvailable = ( testName ) => {
51+ if ( ! testName ) return "No" ;
52+ console . log ( testName ) ;
53+ // Check if any standard's tag array contains a reference to this test
54+ const hasStandard = standardsData . some ( ( standard ) => {
55+ if ( ! standard . tag || ! Array . isArray ( standard . tag ) ) return false ;
56+ // Check if any tag matches the test name or contains it
57+ return standard . tag . some ( ( tag ) => {
58+ const tagLower = tag . toLowerCase ( ) ;
59+ const testLower = testName . toLowerCase ( ) ;
60+ return tagLower . includes ( testLower ) || testLower . includes ( tagLower ) ;
61+ } ) ;
62+ } ) ;
63+
64+ return hasStandard ? "Yes" : "No" ;
65+ } ;
66+
4967// Shared markdown styling for consistent rendering
5068const markdownStyles = {
5169 "& a" : {
@@ -109,7 +127,7 @@ export const CippTestDetailOffCanvas = ({ row }) => {
109127 < Card >
110128 < Grid container >
111129 < Grid
112- size = { { xs : 12 , md : 4 } }
130+ size = { { xs : 12 , md : 3 } }
113131 sx = { {
114132 borderBottom : ( theme ) => ( {
115133 xs : `1px solid ${ theme . palette . divider } ` ,
@@ -123,7 +141,7 @@ export const CippTestDetailOffCanvas = ({ row }) => {
123141 < Stack alignItems = "center" direction = "row" spacing = { 1 } sx = { { p : 1 } } >
124142 < Box >
125143 < Typography color = "text.secondary" variant = "overline" >
126- Risk Level
144+ Risk
127145 </ Typography >
128146 < Box >
129147 < Chip label = { row . Risk || "N/A" } color = { getRiskColor ( row . Risk ) } size = "small" />
@@ -132,7 +150,7 @@ export const CippTestDetailOffCanvas = ({ row }) => {
132150 </ Stack >
133151 </ Grid >
134152 < Grid
135- size = { { xs : 12 , md : 4 } }
153+ size = { { xs : 12 , md : 3 } }
136154 sx = { {
137155 borderBottom : ( theme ) => ( {
138156 xs : `1px solid ${ theme . palette . divider } ` ,
@@ -159,15 +177,21 @@ export const CippTestDetailOffCanvas = ({ row }) => {
159177 </ Stack >
160178 </ Grid >
161179 < Grid
162- size = { { xs : 12 , md : 4 } }
180+ size = { { xs : 12 , md : 3 } }
163181 sx = { {
164- borderBottom : "none" ,
182+ borderBottom : ( theme ) => ( {
183+ xs : `1px solid ${ theme . palette . divider } ` ,
184+ md : "none" ,
185+ } ) ,
186+ borderRight : ( theme ) => ( {
187+ md : `1px solid ${ theme . palette . divider } ` ,
188+ } ) ,
165189 } }
166190 >
167191 < Stack alignItems = "center" direction = "row" spacing = { 1 } sx = { { p : 1 } } >
168192 < Box >
169193 < Typography color = "text.secondary" variant = "overline" >
170- Implementation Effort
194+ Effort
171195 </ Typography >
172196 < Box sx = { { mt : 0.5 } } >
173197 < Chip
@@ -179,6 +203,27 @@ export const CippTestDetailOffCanvas = ({ row }) => {
179203 </ Box >
180204 </ Stack >
181205 </ Grid >
206+ < Grid
207+ size = { { xs : 12 , md : 3 } }
208+ sx = { {
209+ borderBottom : "none" ,
210+ } }
211+ >
212+ < Stack alignItems = "center" direction = "row" spacing = { 1 } sx = { { p : 1 } } >
213+ < Box >
214+ < Typography color = "text.secondary" variant = "overline" >
215+ Standard Available
216+ </ Typography >
217+ < Box sx = { { mt : 0.5 } } >
218+ < Chip
219+ label = { checkCIPPStandardAvailable ( row . RowKey ) }
220+ color = { checkCIPPStandardAvailable ( row . RowKey ) === "Yes" ? "success" : "default" }
221+ size = "small"
222+ />
223+ </ Box >
224+ </ Box >
225+ </ Stack >
226+ </ Grid >
182227 </ Grid >
183228 </ Card >
184229
0 commit comments