MCPcopy Create free account
hub / github.com/codemistic/Web-Development / createUserCard

Function createUserCard

script1.js:24–45  ·  view source on GitHub ↗
(user)

Source from the content-addressed store, hash-verified

22}
23}
24function createUserCard(user) {
25const userID = user.name || user.login
26const userBio = user.bio ? `<p>${user.bio}</p>` : ''
27const cardHTML = `
28<div class="card">
29<div>
30<img src="${user.avatar_url}" alt="${user.name}" class="avatar">
31</div>
32<div class="user-info">
33<h2>${userID}</h2>
34${userBio}
35<ul>
36<li>${user.followers} <strong>Followers</strong></li>
37<li>${user.following} <strong>Following</strong></li>
38<li>${user.public_repos} <strong>Repos</strong></li>
39</ul>
40<div id="repos"></div>
41</div>
42</div>
43`
44main.innerHTML = cardHTML
45}
46function createErrorCard(msg) {
47const cardHTML = `
48<div class="card">

Callers 1

getUserFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected