import {
  AvatarImage,
  Avatar as AvatarComponent,
  AvatarFallback,
} from "../avatar";

export interface AvatarProps extends Omit<React.ComponentProps<typeof AvatarComponent>, never> {
  className?: string;
  imageProps?: React.ComponentProps<typeof AvatarImage>;
  fallbackProps?: React.ComponentProps<typeof AvatarFallback>;
}

export default function Avatar({
  imageProps,
  fallbackProps,
  ...props
}: AvatarProps) {
  return (
    <AvatarComponent {...props}>
      {imageProps && <AvatarImage {...imageProps} />}
      {fallbackProps && <AvatarFallback {...fallbackProps} />}
    </AvatarComponent>
  );
}
