Skip to content
This repository was archived by the owner on Dec 26, 2022. It is now read-only.

Commit c22ce14

Browse files
committed
Hide TotalHours when no billed hours
1 parent 8a2a14a commit c22ce14

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/screens/hours/components/TotalHours/TotalHours.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,20 @@ interface TotalHoursProps {
1414
timeItems: TaskTimeItemModel[];
1515
}
1616

17-
export default observer(function TotalHours({ timeItems }: TotalHoursProps) {
17+
const TotalHours = observer((props: TotalHoursProps) => {
18+
const { timeItems } = props;
19+
1820
const { durationMs, gapsMs } = TaskHooks.useTimeItemsDuration(timeItems);
1921
const startWorkingTime = TaskHooks.useStartWorkingTime(timeItems);
2022
const estimatedWorkingTimeEnd = estimateWorkingTimeEnd(
2123
startWorkingTime,
2224
gapsMs
2325
);
2426

27+
if (!timeItems.length) {
28+
return null;
29+
}
30+
2531
return (
2632
<Space>
2733
<span>{getTime(startWorkingTime)}</span>
@@ -31,3 +37,5 @@ export default observer(function TotalHours({ timeItems }: TotalHoursProps) {
3137
</Space>
3238
);
3339
});
40+
41+
export default TotalHours;

0 commit comments

Comments
 (0)