{/* cirular icon if the chore is due will be red else yellow: */}
{getChoreStatus(chore)}
|
{
Navigate(`/chores/${chore.id}/edit`)
}}
>
{chore.name || '--'}
|
{chore.assignedTo > 0 ? (
p.id === chore.assignedTo)
?.displayName
}
size='sm'
>
{
performers.find(p => p.id === chore.assignedTo)
?.displayName[0]
}
}
>
{performers.find(p => p.id === chore.assignedTo)?.name}
) : (
?}
>
Unassigned
)}
|
{chore.nextDueDate === null
? '--'
: moment(chore.nextDueDate).fromNow()}
|
{
Fetch(`${API_URL}/chores/${chore.id}/do`, {
method: 'POST',
}).then(response => {
if (response.ok) {
response.json().then(data => {
const newChore = data.res
const newChores = [...chores]
const index = newChores.findIndex(
c => c.id === chore.id,
)
newChores[index] = newChore
setChores(newChores)
setFilteredChores(newChores)
})
}
})
}}
aria-setsize={2}
>
{
setChoreId(chore.id)
setIsDateModalOpen(true)
}}
aria-setsize={2}
>
{
Navigate(`/chores/${chore.id}/edit`)
}}
>
|
))}