'use client';

// src/components/Avatar/Avatar.tsx
import * as React from "react";
import { cn } from "@paalan/react-shared/lib";
import * as AvatarPrimitive from "@radix-ui/react-avatar";
import { jsx, jsxs } from "react/jsx-runtime";
var AvatarRoot = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
  AvatarPrimitive.Root,
  {
    ref,
    className: cn("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full", className),
    ...props
  }
));
AvatarRoot.displayName = AvatarPrimitive.Root.displayName;
var AvatarImage = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(AvatarPrimitive.Image, { ref, className: cn("aspect-square h-full w-full", className), ...props }));
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
var AvatarFallback = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
  AvatarPrimitive.Fallback,
  {
    ref,
    className: cn("flex h-full w-full items-center justify-center rounded-full bg-muted", className),
    ...props
  }
));
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
var Avatar = React.forwardRef(
  ({ src, fallback, alt, avatarImageProps, avatarFallbackProps, ...props }, ref) => /* @__PURE__ */ jsxs(AvatarRoot, { ref, ...props, children: [
    /* @__PURE__ */ jsx(AvatarImage, { src, alt, ...avatarImageProps }),
    fallback && /* @__PURE__ */ jsx(AvatarFallback, { ...avatarFallbackProps, children: fallback })
  ] })
);
Avatar.displayName = "Avatar";
export {
  Avatar,
  AvatarFallback,
  AvatarImage,
  AvatarRoot
};
