Spaces:
Configuration error
Configuration error
File size: 871 Bytes
19918ed | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | import Host from './Host.js'
import { a, em, img } from 'https://unpkg.com/ez-html-elements'
/** Create an account object from the JSON returned from the server. */
export default (account) => {
// Account PUBLIC:
return Object.freeze({
/** Is the given id the same as this account's id? */
sameId: (id) => id === account.id,
/** Generate HTML text */
html: () => {
const accountServer = account.url.match(/https:\/\/([^/]+)\//)[1]
return a(
{ href: `#accounts/${account.id}` },
img(['inline'], {
src: account.avatar,
width: 48,
height: 48,
alt: `@${account.username}`
}) +
Host(accountServer).faviconHtml() +
'@' +
account.username +
'@' +
accountServer,
em('(' + account.display_name + ')')
)
}
})
}
|