Skip to content

Commit

Permalink
fix: add as prop to User
Browse files Browse the repository at this point in the history
  • Loading branch information
asabotovich committed Jun 21, 2024
1 parent 9d94940 commit ddbd6dd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/harmony/User/User.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ interface AllowedBadgeProps {
iconRight?: ComponentProps<typeof Badge>['iconRight'];
action?: ComponentProps<typeof Badge>['action'];
view?: ComponentProps<typeof Badge>['view'];
as?: ComponentProps<typeof Badge>['as'];
}

interface UserProps extends AllowedBadgeProps {
Expand Down Expand Up @@ -54,7 +55,7 @@ export const Avatar: React.FC<
};

export const User = forwardRef<HTMLDivElement, UserProps>(
({ email, name, src, short, size = 's', className, ...props }, ref) => {
({ email, name, src, short, size = 's', as = 'div', className, ...props }, ref) => {
return (
<Badge
className={cn(
Expand All @@ -67,7 +68,7 @@ export const User = forwardRef<HTMLDivElement, UserProps>(
},
className,
)}
as="div"
as={as}
ref={ref}
iconLeft={<Avatar src={src} name={name} email={email} size={size} />}
text={nullable(!short, () => (
Expand Down

0 comments on commit ddbd6dd

Please sign in to comment.