`;
}
export function articleListHtml(articles: Article[]): string {
if (articles.length === 0) return "";
let html = "";
for (const article of articles) {
html += articleListItemHtml(article);
}
return `
Articles
${html}
`;
}
function userAddressHtml(profile: Profile) {
let html = "";
if (profile.nip05) {
html += `
Nostr address
${profile.nip05}
\n`;
}
if (profile.lud16) {
html += `
Lightning address
${profile.lud16}
\n`;
}
return html;
}
function nip05VerifiedHtml(verified: boolean): string {
if (verified) {
return ` ✔`;
} else {
return ` ✕`;
}
}
export async function profilePageHtml(
profile: Profile,
articles: Article[],
): Promise {
const title = `${profile.name} on Nostr`;
let nip05Html = "";
if (profile.nip05) {
const nip05Verified = await profile.verifyNip05();
nip05Html += `