Cleanup status object

This commit is contained in:
2025-09-05 11:52:11 -05:00
parent 1a9871ac5d
commit 7cfc11d30c
11 changed files with 700 additions and 38 deletions

View File

@@ -132,9 +132,9 @@ export const StatusList = ({
<div className={cardContainerCn}>
{statuses.map((status) => {
const { user: u, latest, updatedByUser } = status;
const { user: u, status: s } = status;
const isSelected = selectedUserIds.includes(u.id);
const isUpdatedByOther = !!updatedByUser;
const isUpdatedByOther = !!s?.updatedBy;
return (
<Card
key={u.id}
@@ -189,7 +189,7 @@ export const StatusList = ({
${tvMode ? 'text-2xl' : 'text-xl'}
`}
>
<p>{latest?.message ?? 'No status yet.'}</p>
<p>{s?.message ?? 'No status yet.'}</p>
</div>
</div>
@@ -200,7 +200,7 @@ export const StatusList = ({
<div className='flex items-center gap-2'>
<Clock className={tvMode ? 'w-6 h-6' : 'w-5 h-5'} />
<span className={tvMode ? 'text-2xl' : 'text-xl'}>
{latest ? formatTime(latest.updatedAt) : '--:--'}
{s ? formatTime(s.updatedAt) : '--:--'}
</span>
</div>
<div className='flex items-center gap-2'>
@@ -208,21 +208,21 @@ export const StatusList = ({
className={tvMode ? 'w-6 h-6' : 'w-5 h-5'}
/>
<span className={tvMode ? 'text-2xl' : 'text-xl'}>
{latest ? formatDate(latest.updatedAt) : '--/--'}
{s ? formatDate(s.updatedAt) : '--/--'}
</span>
</div>
{isUpdatedByOther && updatedByUser && (
{isUpdatedByOther && s.updatedBy && (
<div className='flex items-center gap-2'>
<BasedAvatar
src={updatedByUser.imageUrl}
fullName={updatedByUser.name ?? 'User'}
src={s.updatedBy.imageUrl}
fullName={s.updatedBy.name ?? 'User'}
className={tvMode ? 'w-6 h-6' : 'w-5 h-5'}
/>
<span className={tvMode ? 'text-base' : 'text-sm'}>
<div className='flex flex-col'>
<p>Updated by</p>
{updatedByUser.name ?? 'User'}
{s.updatedBy.name ?? 'User'}
</div>
</span>
</div>
@@ -264,7 +264,7 @@ export const StatusList = ({
onKeyDown={(e) => {
if (e.key === 'Enter' && !e.shiftKey && !updatingStatus) {
e.preventDefault();
handleUpdateStatus();
void handleUpdateStatus();
}
}}
/>