// src/components/Sidebar/UserInfo.jsx import React from 'react'; const UserInfo = ({ currentUser }) => { // Sử dụng ảnh mặc định nếu currentUser không có hoặc không có avatar const avatarUrl = currentUser?.avatar || `https://ui-avatars.com/api/?name=${currentUser?.name || 'User'}&background=ffffff&color=3b82f6`; const userName = currentUser?.name || 'Đang tải...'; const userRole = currentUser?.role || 'Đang tải...'; const userId = currentUser?.id || ''; // Giả sử currentUser có id return (
{userName}
{userRole}
{userId && ({/* Có thể bạn không muốn hiển thị User ID ở đây, tùy theo thiết kế */} {/* ID: {userId} */}
)}