Co-authored-by: lethemanh <lethemanh@lethemanhs-MacBook-Pro.local>
This commit is contained in:
@@ -1,11 +1,31 @@
|
||||
import { Avatar } from "@linagora/twake-mui";
|
||||
import { Avatar, Box } from "@linagora/twake-mui";
|
||||
import LayersOutlinedIcon from "@mui/icons-material/LayersOutlined";
|
||||
|
||||
interface ResourceIconProps {
|
||||
avatarUrl?: string;
|
||||
colorIcon?: boolean;
|
||||
color?: string;
|
||||
}
|
||||
|
||||
export function ResourceIcon({ avatarUrl }: ResourceIconProps) {
|
||||
export function ResourceIcon({
|
||||
avatarUrl,
|
||||
colorIcon,
|
||||
color,
|
||||
}: ResourceIconProps) {
|
||||
if (colorIcon && avatarUrl) {
|
||||
return (
|
||||
<Box
|
||||
sx={{
|
||||
width: "24px",
|
||||
height: "24px",
|
||||
backgroundColor: color,
|
||||
maskImage: `url(${avatarUrl})`,
|
||||
maskSize: "cover",
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
return avatarUrl ? (
|
||||
<Avatar
|
||||
sx={{ backgroundColor: "transparent", width: "24px", height: "24px" }}
|
||||
|
||||
Reference in New Issue
Block a user