File tree 1 file changed +4
-6
lines changed
web/src/pages/Courts/CourtDetails
1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -17,16 +17,19 @@ const TABS = [
17
17
text : "Purpose" ,
18
18
value : 0 ,
19
19
path : "purpose" ,
20
+ isVisible : ( policy : any ) => ! ! policy ?. description ,
20
21
} ,
21
22
{
22
23
text : "Skills" ,
23
24
value : 1 ,
24
25
path : "skills" ,
26
+ isVisible : ( policy : any ) => ! ! policy ?. requiredSkills ,
25
27
} ,
26
28
{
27
29
text : "Policy" ,
28
30
value : 2 ,
29
31
path : "policy" ,
32
+ isVisible : ( policy : any ) => ! ! policy ?. summary ,
30
33
} ,
31
34
] ;
32
35
@@ -43,12 +46,7 @@ const Description: React.FC = () => {
43
46
[ currentPathName ]
44
47
) ;
45
48
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 ) ) ;
52
50
53
51
return (
54
52
< Container >
You can’t perform that action at this time.
0 commit comments