import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
/**
 * UserAvatar
 * Show user picture, name and email
 **/
export function UserAvatar({ user }) {
    const userPicture = () => {
        if (!user.picture) {
            const initials = user.name.split(' ').map((n) => n[0]).join('');
            return _jsx("span", { className: "inline-flex h-8 w-8 items-center justify-center rounded-full bg-indigo-600", children: _jsx("span", { className: "text-sm font-medium leading-none text-white", children: initials }) });
        }
        else {
            return _jsx("img", { className: "inline-block h-9 w-9 rounded-full", src: user.picture, alt: user.name });
        }
    };
    return (_jsxs("div", { className: "flex items-center", children: [_jsx("div", { className: "w-9 h-9", children: userPicture() }), _jsxs("div", { className: "ml-3", children: [_jsx("p", { className: "text-sm font-medium text-gray-700 dark:text-slate-50 group-hover:text-gray-900", children: user.name ?? 'Deleted User' }), _jsx("p", { className: "text-xs font-medium text-gray-500 dark:text-slate-300 group-hover:text-gray-700", children: user.email ?? 'Deleted User' })] })] }));
}
//# sourceMappingURL=UserAvatar.js.map