Skip to content

Commit 2b5ef83

Browse files
committed
Rename components in TaskTable
1 parent 5f5fae4 commit 2b5ef83

File tree

1 file changed

+9
-10
lines changed
  • frontend/src/components/Pages/MissionPage/TaskOverview

1 file changed

+9
-10
lines changed

frontend/src/components/Pages/MissionPage/TaskOverview/TaskTable.tsx

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ interface MissionProps {
1818

1919
export const TaskTable = ({ mission }: MissionProps) => {
2020
const { TranslateText } = useLanguageContext()
21-
const rows = mission && mission.tasks.length > 0 ? RenderTasks(mission.tasks) : <></>
2221
return (
2322
<StyledTable>
2423
<Table.Caption>
@@ -33,12 +32,12 @@ export const TaskTable = ({ mission }: MissionProps) => {
3332
<Table.Cell>{TranslateText('Status')}</Table.Cell>
3433
</Table.Row>
3534
</Table.Head>
36-
<Table.Body>{rows}</Table.Body>
35+
<Table.Body>{mission && <TaskTableRows tasks={mission.tasks} />}</Table.Body>
3736
</StyledTable>
3837
)
3938
}
4039

41-
const RenderTasks = (tasks: Task[]) => {
40+
const TaskTableRows = ({ tasks }: { tasks: Task[] }) => {
4241
const rows = tasks.map((task) => {
4342
// Workaround for current bug in echo
4443
const order: number = task.taskOrder < 214748364 ? task.taskOrder + 1 : 1
@@ -57,24 +56,24 @@ const RenderTasks = (tasks: Task[]) => {
5756
</Chip>
5857
</Table.Cell>
5958
<Table.Cell>
60-
<RenderTagId task={task} />
59+
<TagIdDisplay task={task} />
6160
</Table.Cell>
6261
<Table.Cell>
63-
<RenderDescription task={task} />
62+
<DescriptionDisplay task={task} />
6463
</Table.Cell>
6564
<Table.Cell>
66-
<RenderInspectionTypes task={task} />
65+
<InspectionTypesDisplay task={task} />
6766
</Table.Cell>
6867
<Table.Cell>
6968
<TaskStatusDisplay status={task.status} />
7069
</Table.Cell>
7170
</Table.Row>
7271
)
7372
})
74-
return rows
73+
return <>{rows}</>
7574
}
7675

77-
const RenderTagId = ({ task }: { task: Task }) => {
76+
const TagIdDisplay = ({ task }: { task: Task }) => {
7877
if (!task.tagId) return <Typography key={task.id + 'tagId'}>{'N/A'}</Typography>
7978

8079
if (task.echoTagLink)
@@ -86,12 +85,12 @@ const RenderTagId = ({ task }: { task: Task }) => {
8685
else return <Typography key={task.id + 'tagId'}>{task.tagId!}</Typography>
8786
}
8887

89-
const RenderDescription = ({ task }: { task: Task }) => {
88+
const DescriptionDisplay = ({ task }: { task: Task }) => {
9089
if (!task.description) return <Typography key={task.id + 'descr'}>{'N/A'}</Typography>
9190
return <Typography key={task.id + 'descr'}>{task.description}</Typography>
9291
}
9392

94-
const RenderInspectionTypes = ({ task }: { task: Task }) => {
93+
const InspectionTypesDisplay = ({ task }: { task: Task }) => {
9594
return (
9695
<>
9796
{task.inspections?.map((inspection) => {

0 commit comments

Comments
 (0)