/**
* Domain detail view
*/
class DomainDetailView {
constructor() {
this.currentDomain = null;
this.data = null;
this.chart = null;
}
/**
* Render peer with profile (avatar + display name or peer ID)
* @param {string} peerId - Peer ID
* @param {object|null} profile - Profile data or null
* @param {number} avatarSize - Avatar size in pixels (default: 32)
* @returns {string} HTML string for peer display
*/
renderPeerWithProfile(peerId, profile, avatarSize = 32) {
const displayName = profile?.displayName || null;
const avatarHash = profile?.avatarHash || null;
const avatarUrl = avatarHash
? `https://global.profile/api/profile/avatar/${peerId}/${avatarSize}`
: null;
const peerIdShort = window.utils.formatPeerId(peerId);
const avatarHtml = avatarUrl
? `
Loading domain details...
Error loading domain details: ${error.message}
${consensus.totalVotes || 0}
${consensus.minVotes || 0}
${consensus.quorumMet ? 'Met' : 'Not Met'}
${consensus.activePeers || 0}
| Claimant | Hash | Votes | Timestamp |
|---|---|---|---|
| ${this.renderPeerWithProfile(claim.claimant, profile, 32)} ${isResolved ? '(resolved)' : ''} |
${window.utils.formatHash(claim.hash)}
|
${voteCount} | ${window.utils.formatTimestamp(claim.timestamp)} |
No claims found
`}| Voter | Voted For |
|---|---|
| ${this.renderPeerWithProfile(vote.voter, voterProfile, 32)} | ${this.renderPeerWithProfile(vote.claimant, claimantProfile, 32)} ${isResolved ? '(resolved claimant)' : ''} |
No votes found
`}