PromucFlow_constructor/app/client/src/icons/AlertIcons.tsx

36 lines
1.0 KiB
TypeScript
Raw Normal View History

2020-02-25 11:33:07 +00:00
import React, { JSXElementConstructor } from "react";
2020-02-18 10:41:52 +00:00
import { IconProps, IconWrapper } from "constants/IconConstants";
import { ReactComponent as InfoIcon } from "assets/icons/alert/info.svg";
import { ReactComponent as SuccessIcon } from "assets/icons/alert/success.svg";
import { ReactComponent as ErrorIcon } from "assets/icons/alert/error.svg";
import { ReactComponent as WarningIcon } from "assets/icons/alert/warning.svg";
/* eslint-disable react/display-name */
export const AlertIcons: {
2020-02-25 11:33:07 +00:00
[id: string]: JSXElementConstructor<IconProps>;
2020-02-18 10:41:52 +00:00
} = {
INFO: (props: IconProps) => (
<IconWrapper {...props}>
<InfoIcon />
</IconWrapper>
),
SUCCESS: (props: IconProps) => (
<IconWrapper {...props}>
<SuccessIcon />
</IconWrapper>
),
ERROR: (props: IconProps) => (
<IconWrapper {...props}>
<ErrorIcon />
</IconWrapper>
),
WARNING: (props: IconProps) => (
<IconWrapper {...props}>
<WarningIcon />
</IconWrapper>
),
};
export type AlertIconName = keyof typeof AlertIcons;