Merged in feat/SW-1711-SW-2077-icons (pull request #1709)

Fix(SW-1711)/(SW-2077): Export icons individually

* fix(SW-1711): export icons individually


Approved-by: Michael Zetterberg
Approved-by: Erik Tiekstra
This commit is contained in:
Matilda Landström
2025-04-07 07:25:25 +00:00
parent 02cae62e57
commit 1239f0c662
234 changed files with 446 additions and 472 deletions

View File

@@ -1,41 +1,36 @@
/* eslint-disable react/display-name */
import {
MaterialIcon,
type MaterialIconSetIconProps,
} from "@scandic-hotels/design-system/Icons"
} from "@scandic-hotels/design-system/Icons/MaterialIcon"
import { AlertTypeEnum } from "@/types/enums/alert"
export function getIconByAlertType(alertType: AlertTypeEnum) {
interface IconByAlertProps {
alertType: AlertTypeEnum
}
export function IconByAlertType({
alertType,
...props
}: IconByAlertProps & MaterialIconSetIconProps): JSX.Element {
switch (alertType) {
case AlertTypeEnum.Alarm:
return function (props: MaterialIconSetIconProps) {
return (
<MaterialIcon
color="Icon/Inverted"
isFilled
icon="cancel"
{...props}
/>
)
}
return (
<MaterialIcon color="Icon/Inverted" isFilled icon="cancel" {...props} />
)
case AlertTypeEnum.Warning:
return function (props: MaterialIconSetIconProps) {
return (
<MaterialIcon
icon="warning"
color="Icon/Inverted"
isFilled
{...props}
/>
)
}
return (
<MaterialIcon
icon="warning"
color="Icon/Inverted"
isFilled
{...props}
/>
)
case AlertTypeEnum.Info:
default:
return function (props: MaterialIconSetIconProps) {
return (
<MaterialIcon color="Icon/Inverted" isFilled icon="info" {...props} />
)
}
return (
<MaterialIcon color="Icon/Inverted" isFilled icon="info" {...props} />
)
}
}