export function renderGitHub(data, username) {
if (!data) {
const card = createErrorCard('GitHub', username, 'Profile data not available');
return card;
}
const card = createProfileCard('github', 'GitHub');
// Profile header and avatar
card.querySelector('.user-info').innerHTML = `
${data.user_readme.substring(0, 1000)}${data.user_readme.length > 1000 ? '...' : ''}
`;
card.querySelector('.profile-body').appendChild(readmeSection);
}
// Set profile picture
const profilePic = card.querySelector('.profile-pic');
profilePic.src = data.avatar_url || '';
profilePic.onerror = () => {
profilePic.src = 'https://github.com/apple-touch-icon.png';
};
return card;
}
// Added missing functions directly to this file
function createProfileCard(platform, title) {
const card = document.createElement('div');
card.className = `profile-card ${platform}-card`;
card.innerHTML = `
⚠️
Error loading ${platform} profile for "${username}":
${message}
`;
return card;
}