import {
  __objRest,
  __spreadProps,
  __spreadValues
} from "./chunk-N552FDTV.js";

// src/atoms/avatar.tsx
import {
  Avatar as RadixAvatar
} from "@radix-ui/themes";
import { useMemo, forwardRef, useCallback } from "react";
import { jsx } from "react/jsx-runtime";
var Avatar = forwardRef(
  (props, ref) => {
    const _a = props, { children, size, variant = "soft" } = _a, rest = __objRest(_a, ["children", "size", "variant"]);
    const getOriginalSize = useCallback((value) => {
      switch (value) {
        case "small":
          return "1";
        case "medium":
          return "2";
        case "large":
          return "3";
        case "full":
          return "4";
        default:
          return "3";
      }
    }, []);
    const radixSize = useMemo(() => {
      if (typeof size === "string") {
        return getOriginalSize(size);
      }
      if (typeof size === "object") {
        const map = {};
        let key;
        for (key in size) {
          map[key] = size[key] && getOriginalSize(size[key]);
        }
        return map;
      }
    }, [getOriginalSize, size]);
    return /* @__PURE__ */ jsx(RadixAvatar, __spreadProps(__spreadValues({}, rest), { ref, size: radixSize, variant, children }));
  }
);
Avatar.displayName = "Avatar";

export {
  Avatar
};
//# sourceMappingURL=chunk-JYJA2PMG.js.map