|
|
@ -533,7 +533,7 @@ function StatusDetailsDialog({ message }: { message: any }) { |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function MessageCard({ message, type }) { |
|
|
|
|
|
|
|
|
function MessageCard({ message, type, device }) { |
|
|
const isSent = type === 'sent' |
|
|
const isSent = type === 'sent' |
|
|
|
|
|
|
|
|
const formattedDate = new Date( |
|
|
const formattedDate = new Date( |
|
|
@ -546,6 +546,8 @@ function MessageCard({ message, type }) { |
|
|
year: 'numeric', |
|
|
year: 'numeric', |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
const shouldShowStatus = device?.appVersionCode >= 14 && new Date(message?.createdAt) > new Date('2025-04-11') |
|
|
|
|
|
|
|
|
return ( |
|
|
return ( |
|
|
<Card |
|
|
<Card |
|
|
className={`hover:bg-muted/50 transition-colors max-w-sm md:max-w-none ${ |
|
|
className={`hover:bg-muted/50 transition-colors max-w-sm md:max-w-none ${ |
|
|
@ -586,7 +588,7 @@ function MessageCard({ message, type }) { |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div className='flex justify-between items-center'> |
|
|
<div className='flex justify-between items-center'> |
|
|
{isSent && ( |
|
|
|
|
|
|
|
|
{isSent && shouldShowStatus && ( |
|
|
<div className='flex items-center'> |
|
|
<div className='flex items-center'> |
|
|
<StatusDetailsDialog message={message} /> |
|
|
<StatusDetailsDialog message={message} /> |
|
|
</div> |
|
|
</div> |
|
|
@ -906,6 +908,7 @@ export default function MessageHistory() { |
|
|
key={message._id} |
|
|
key={message._id} |
|
|
message={message} |
|
|
message={message} |
|
|
type={message.sender ? 'received' : 'sent'} |
|
|
type={message.sender ? 'received' : 'sent'} |
|
|
|
|
|
device={devices?.data?.find((device) => device._id === currentDevice)} |
|
|
/> |
|
|
/> |
|
|
))} |
|
|
))} |
|
|
</div> |
|
|
</div> |
|
|
|