@@ -18,7 +18,6 @@ interface MissionProps {
18
18
19
19
export const TaskTable = ( { mission } : MissionProps ) => {
20
20
const { TranslateText } = useLanguageContext ( )
21
- const rows = mission && mission . tasks . length > 0 ? RenderTasks ( mission . tasks ) : < > </ >
22
21
return (
23
22
< StyledTable >
24
23
< Table . Caption >
@@ -33,12 +32,12 @@ export const TaskTable = ({ mission }: MissionProps) => {
33
32
< Table . Cell > { TranslateText ( 'Status' ) } </ Table . Cell >
34
33
</ Table . Row >
35
34
</ Table . Head >
36
- < Table . Body > { rows } </ Table . Body >
35
+ < Table . Body > { mission && < TaskTableRows tasks = { mission . tasks } /> } </ Table . Body >
37
36
</ StyledTable >
38
37
)
39
38
}
40
39
41
- const RenderTasks = ( tasks : Task [ ] ) => {
40
+ const TaskTableRows = ( { tasks } : { tasks : Task [ ] } ) => {
42
41
const rows = tasks . map ( ( task ) => {
43
42
// Workaround for current bug in echo
44
43
const order : number = task . taskOrder < 214748364 ? task . taskOrder + 1 : 1
@@ -57,24 +56,24 @@ const RenderTasks = (tasks: Task[]) => {
57
56
</ Chip >
58
57
</ Table . Cell >
59
58
< Table . Cell >
60
- < RenderTagId task = { task } />
59
+ < TagIdDisplay task = { task } />
61
60
</ Table . Cell >
62
61
< Table . Cell >
63
- < RenderDescription task = { task } />
62
+ < DescriptionDisplay task = { task } />
64
63
</ Table . Cell >
65
64
< Table . Cell >
66
- < RenderInspectionTypes task = { task } />
65
+ < InspectionTypesDisplay task = { task } />
67
66
</ Table . Cell >
68
67
< Table . Cell >
69
68
< TaskStatusDisplay status = { task . status } />
70
69
</ Table . Cell >
71
70
</ Table . Row >
72
71
)
73
72
} )
74
- return rows
73
+ return < > { rows } </ >
75
74
}
76
75
77
- const RenderTagId = ( { task } : { task : Task } ) => {
76
+ const TagIdDisplay = ( { task } : { task : Task } ) => {
78
77
if ( ! task . tagId ) return < Typography key = { task . id + 'tagId' } > { 'N/A' } </ Typography >
79
78
80
79
if ( task . echoTagLink )
@@ -86,12 +85,12 @@ const RenderTagId = ({ task }: { task: Task }) => {
86
85
else return < Typography key = { task . id + 'tagId' } > { task . tagId ! } </ Typography >
87
86
}
88
87
89
- const RenderDescription = ( { task } : { task : Task } ) => {
88
+ const DescriptionDisplay = ( { task } : { task : Task } ) => {
90
89
if ( ! task . description ) return < Typography key = { task . id + 'descr' } > { 'N/A' } </ Typography >
91
90
return < Typography key = { task . id + 'descr' } > { task . description } </ Typography >
92
91
}
93
92
94
- const RenderInspectionTypes = ( { task } : { task : Task } ) => {
93
+ const InspectionTypesDisplay = ( { task } : { task : Task } ) => {
95
94
return (
96
95
< >
97
96
{ task . inspections ?. map ( ( inspection ) => {
0 commit comments