import { jsx as _jsx } from "react/jsx-runtime";
/*
 * Copyright (c) 2023-2025 Datalayer, Inc.
 * Distributed under the terms of the Modified BSD License.
 */
import { Avatar, Link } from '@primer/react';
import { Box } from '@datalayer/primer-addons';
import { AvatarSkeleton } from '../../components/display/index.js';
import { getAvatarURL } from '../../utils/index.js';
const Profile = ({ user, size = 100, onClick }) => {
    return (_jsx(Box, { style: { width: size }, children: _jsx(Avatar
        //      square
        , { 
            //      square
            src: getAvatarURL(user?.avatarUrl), size: size, onClick: onClick }) }));
};
export const UserProfileAvatar = ({ onClick, user, size = 100, }) => {
    return user ? (onClick ? (_jsx(Link, { href: "javascript: return false;", onClick: onClick, children: _jsx(Profile, { user: user, size: size, onClick: onClick }) })) : (_jsx(Profile, { user: user, size: size, onClick: onClick }))) : (_jsx(AvatarSkeleton, { size: size }));
};
export default UserProfileAvatar;
