import { _objectSpread2 } from "../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
import { getAvatarText } from "../../utils.js";
import { PREFIX } from "../../index.js";
import React from "react";
import { PisellAvatar } from "@pisell/materials";
import "../../index.less";
//#region src/plus/contactInfo/components/Avatar/index.tsx
const Avatar = (props) => {
	const { config, name, cover } = props;
	const { useTextAvatar, children } = config || {};
	if (useTextAvatar) {
		const text = children || getAvatarText(name);
		return /* @__PURE__ */ React.createElement("div", { className: `${PREFIX}__avatar-wrapper` }, /* @__PURE__ */ React.createElement(PisellAvatar, _objectSpread2({ className: `${PREFIX}__avatar` }, config || {}), text));
	}
	return /* @__PURE__ */ React.createElement("div", { className: `${PREFIX}__avatar-wrapper` }, /* @__PURE__ */ React.createElement(PisellAvatar, _objectSpread2(_objectSpread2({ className: `${PREFIX}__avatar` }, config || {}), {}, { src: cover || "" })));
};
//#endregion
export { Avatar as default };
