feat: add dynamic flow app icons

This commit is contained in:
Ali BARIN
2022-08-06 23:41:39 +02:00
parent 82bdf9d3b1
commit 744b31aad6
8 changed files with 58 additions and 20 deletions

View File

@@ -14,7 +14,16 @@ const inlineImgStyle: React.CSSProperties = {
};
export default function AppIcon(props: AppIconProps & AvatarProps): React.ReactElement {
const { name, url, color, sx = {}, variant = "square", ...restProps } = props;
const {
name,
url,
color,
sx = {},
variant = "square",
...restProps
} = props;
const initialLetter = name?.[0];
return (
<Avatar
@@ -24,6 +33,7 @@ export default function AppIcon(props: AppIconProps & AvatarProps): React.ReactE
imgProps={{ style: inlineImgStyle }}
src={url}
alt={name}
children={initialLetter}
{...restProps}
/>
);