Fix(SW-1711)/(SW-2077): Export icons individually * fix(SW-1711): export icons individually Approved-by: Michael Zetterberg Approved-by: Erik Tiekstra
37 lines
842 B
TypeScript
37 lines
842 B
TypeScript
import {
|
|
MaterialIcon,
|
|
type MaterialIconSetIconProps,
|
|
} from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
|
|
|
import { AlertTypeEnum } from "@/types/enums/alert"
|
|
|
|
interface IconByAlertProps {
|
|
alertType: AlertTypeEnum
|
|
}
|
|
|
|
export function IconByAlertType({
|
|
alertType,
|
|
...props
|
|
}: IconByAlertProps & MaterialIconSetIconProps): JSX.Element {
|
|
switch (alertType) {
|
|
case AlertTypeEnum.Alarm:
|
|
return (
|
|
<MaterialIcon color="Icon/Inverted" isFilled icon="cancel" {...props} />
|
|
)
|
|
case AlertTypeEnum.Warning:
|
|
return (
|
|
<MaterialIcon
|
|
icon="warning"
|
|
color="Icon/Inverted"
|
|
isFilled
|
|
{...props}
|
|
/>
|
|
)
|
|
case AlertTypeEnum.Info:
|
|
default:
|
|
return (
|
|
<MaterialIcon color="Icon/Inverted" isFilled icon="info" {...props} />
|
|
)
|
|
}
|
|
}
|