@cccsaurora/howler-ui 2.17.0-dev.557 → 2.17.0-dev.559

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { getIcon, Icon } from '@iconify/react';
2
+ import { Icon } from '@iconify/react';
3
3
  import Avatar from '@mui/material/Avatar';
4
4
  import { useAppTheme } from '@cccsaurora/howler-ui/commons/components/app/hooks';
5
5
  import { ApiConfigContext } from '@cccsaurora/howler-ui/components/app/providers/ApiConfigProvider';
@@ -10,23 +10,27 @@ const RelatedIcon = ({ icon, title, href, compact = false }) => {
10
10
  if (!icon) {
11
11
  return null;
12
12
  }
13
- if (getIcon(icon)) {
14
- return _jsx(Icon, { fontSize: "1.5rem", icon: icon });
15
- }
13
+ let avatarImage = null;
16
14
  const app = config.configuration.ui.apps.find(a => a.name.toLowerCase() === icon?.toLowerCase());
17
15
  if (app) {
18
16
  // use the image link for the configured related application instead
19
- icon = app[`img_${isDark ? 'd' : 'l'}`];
17
+ avatarImage = app[`img_${isDark ? 'd' : 'l'}`];
18
+ }
19
+ else if (icon.startsWith('http')) {
20
+ avatarImage = icon;
21
+ }
22
+ if (avatarImage) {
23
+ return (_jsx(Avatar, { variant: "rounded", alt: title ?? href, src: avatarImage, sx: [
24
+ theme => ({
25
+ width: theme.spacing(compact ? 4 : 6),
26
+ height: theme.spacing(compact ? 4 : 6),
27
+ '& img': {
28
+ objectFit: 'contain'
29
+ }
30
+ }),
31
+ !avatarImage && { backgroundColor: 'transparent' }
32
+ ], children: avatarImage }));
20
33
  }
21
- return (_jsx(Avatar, { variant: "rounded", alt: title ?? href, src: icon, sx: [
22
- theme => ({
23
- width: theme.spacing(compact ? 4 : 6),
24
- height: theme.spacing(compact ? 4 : 6),
25
- '& img': {
26
- objectFit: 'contain'
27
- }
28
- }),
29
- !icon && { backgroundColor: 'transparent' }
30
- ], children: icon }));
34
+ return _jsx(Icon, { fontSize: "1.5rem", icon: icon });
31
35
  };
32
36
  export default RelatedIcon;
package/package.json CHANGED
@@ -101,7 +101,7 @@
101
101
  "internal-slot": "1.0.7"
102
102
  },
103
103
  "type": "module",
104
- "version": "2.17.0-dev.557",
104
+ "version": "2.17.0-dev.559",
105
105
  "exports": {
106
106
  "./i18n": "./i18n.js",
107
107
  "./index.css": "./index.css",