File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
web/src/pages/Courts/CourtDetails Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -17,16 +17,19 @@ const TABS = [
1717 text : "Purpose" ,
1818 value : 0 ,
1919 path : "purpose" ,
20+ isVisible : ( policy : any ) => ! ! policy ?. description ,
2021 } ,
2122 {
2223 text : "Skills" ,
2324 value : 1 ,
2425 path : "skills" ,
26+ isVisible : ( policy : any ) => ! ! policy ?. requiredSkills ,
2527 } ,
2628 {
2729 text : "Policy" ,
2830 value : 2 ,
2931 path : "policy" ,
32+ isVisible : ( policy : any ) => ! ! policy ?. summary ,
3033 } ,
3134] ;
3235
@@ -43,12 +46,7 @@ const Description: React.FC = () => {
4346 [ currentPathName ]
4447 ) ;
4548
46- const filteredTabs = TABS . filter ( ( tab ) => {
47- if ( tab . path === "skills" && ! policy ?. requiredSkills ) {
48- return false ;
49- }
50- return true ;
51- } ) ;
49+ const filteredTabs = TABS . filter ( ( { isVisible } ) => isVisible ( policy ) ) ;
5250
5351 return (
5452 < Container >
You can’t perform that action at this time.
0 commit comments