aboutsummaryrefslogtreecommitdiffstats
path: root/src/views/History/HistoryCard.jsx
diff options
context:
space:
mode:
authorLibravatar Mo Tarbin <mhed.t91@gmail.com>2024-07-20 03:41:23 -0400
committerLibravatar Mo Tarbin <mhed.t91@gmail.com>2024-07-20 03:41:23 -0400
commitcb4fcc82f2c5e42b50390e9271e360f1ef95c126 (patch)
tree7cd9c284ced7db3c9e9e8d351ee6fde9e45bf012 /src/views/History/HistoryCard.jsx
parentdff0ae504ac7c1cc4e3b45c4e316d5a0d55e75c3 (diff)
parent90efb5be001393134aaef07fe11e9ad605692043 (diff)
downloaddonetick-frontend-cb4fcc82f2c5e42b50390e9271e360f1ef95c126.tar.gz
donetick-frontend-cb4fcc82f2c5e42b50390e9271e360f1ef95c126.tar.bz2
donetick-frontend-cb4fcc82f2c5e42b50390e9271e360f1ef95c126.zip
Merge branch 'dev'
Diffstat (limited to 'src/views/History/HistoryCard.jsx')
-rw-r--r--src/views/History/HistoryCard.jsx18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/views/History/HistoryCard.jsx b/src/views/History/HistoryCard.jsx
index 5e71f52..34a0b33 100644
--- a/src/views/History/HistoryCard.jsx
+++ b/src/views/History/HistoryCard.jsx
@@ -11,7 +11,13 @@ import {
} from '@mui/joy'
import moment from 'moment'
-const HistoryCard = ({ allHistory, performers, historyEntry, index }) => {
+const HistoryCard = ({
+ allHistory,
+ performers,
+ historyEntry,
+ index,
+ onClick,
+}) => {
function formatTimeDifference(startDate, endDate) {
const diffInMinutes = moment(startDate).diff(endDate, 'minutes')
let timeValue = diffInMinutes
@@ -64,7 +70,7 @@ const HistoryCard = ({ allHistory, performers, historyEntry, index }) => {
icon = <Timelapse />
} else {
text = 'No Due Date'
- color = 'info'
+ color = 'neutral'
icon = <CalendarViewDay />
}
@@ -77,7 +83,7 @@ const HistoryCard = ({ allHistory, performers, historyEntry, index }) => {
return (
<>
- <ListItem sx={{ gap: 1.5, alignItems: 'flex-start' }}>
+ <ListItem sx={{ gap: 1.5, alignItems: 'flex-start' }} onClick={onClick}>
{' '}
{/* Adjusted spacing and alignment */}
<ListItemDecorator>
@@ -98,7 +104,11 @@ const HistoryCard = ({ allHistory, performers, historyEntry, index }) => {
}}
>
<Typography level='body1' sx={{ fontWeight: 'md' }}>
- {moment(historyEntry.completedAt).format('ddd MM/DD/yyyy HH:mm')}
+ {historyEntry.completedAt
+ ? moment(historyEntry.completedAt).format(
+ 'ddd MM/DD/yyyy HH:mm',
+ )
+ : 'Skipped'}
</Typography>
{getCompletedChip(historyEntry)}
</Box>