mirror of
https://github.com/docmost/docmost.git
synced 2026-05-07 14:43:06 +08:00
60848ea903
* feat: MCP * sync * sync
36 lines
806 B
TypeScript
36 lines
806 B
TypeScript
import React from "react";
|
|
import { Avatar } from "@mantine/core";
|
|
import { getAvatarUrl } from "@/lib/config.ts";
|
|
import { AvatarIconType } from "@/features/attachments/types/attachment.types.ts";
|
|
|
|
interface CustomAvatarProps {
|
|
avatarUrl?: string;
|
|
name: string;
|
|
color?: string;
|
|
size?: string | number;
|
|
radius?: string | number;
|
|
variant?: string;
|
|
style?: any;
|
|
component?: any;
|
|
type?: AvatarIconType;
|
|
mt?: string | number;
|
|
}
|
|
|
|
export const CustomAvatar = React.forwardRef<
|
|
HTMLInputElement,
|
|
CustomAvatarProps
|
|
>(({ avatarUrl, name, type, ...props }: CustomAvatarProps, ref) => {
|
|
const avatarLink = getAvatarUrl(avatarUrl, type);
|
|
|
|
return (
|
|
<Avatar
|
|
ref={ref}
|
|
src={avatarLink}
|
|
name={name}
|
|
alt={name}
|
|
color="initials"
|
|
{...props}
|
|
/>
|
|
);
|
|
});
|