24 lines
576 B
TypeScript
24 lines
576 B
TypeScript
import {
|
|
AvatarImage,
|
|
Avatar as AvatarComponent,
|
|
AvatarFallback,
|
|
} from "../avatar";
|
|
|
|
interface AvatarProps extends React.ComponentProps<typeof AvatarComponent> {
|
|
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>
|
|
);
|
|
}
|