${profile
? html`
`
: html`
`}
`
)}
${statuses.map((status, i) => {
const handle = didHandleMap[status.authorDid] || status.authorDid
const date = ts(status)
return html`
@${handle}
${date === TODAY
? `is feeling ${status.status} today`
: `was feeling ${status.status} on ${date}`}
`
})}
`
}
function toBskyLink(did: string) {
return `https://bsky.app/profile/${did}`
}
function ts(status: Status) {
const indexedAt = new Date(status.indexedAt)
const updatedAt = new Date(status.updatedAt)
if (updatedAt > indexedAt) return updatedAt.toDateString()
return indexedAt.toDateString()
}