import { jsx } from 'react/jsx-runtime';
import React__default from 'react';
import { Avatar } from '../Avatar/Avatar.js';
import { useMessageContext } from './MessageContext.js';

const MessageAvatar = React__default.forwardRef(({ src, name, fallback, className, ...props }, ref) => {
    const { variant } = useMessageContext();
    // Don't render avatar for system messages
    if (variant === "system") {
        return null;
    }
    return (jsx("div", { ref: ref, className: className, ...props, children: jsx(Avatar, { src: src, name: name, fallback: fallback, size: "xs" }) }));
});
MessageAvatar.displayName = "Message.Avatar";

export { MessageAvatar };
