@lunit/oui
Version:
Lunit Oncology UI components
40 lines (39 loc) • 1.16 kB
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import { Success, Warning, Information } from '../../icons';
import theme from '../../theme';
export const getIcons = (severity) => {
switch (severity) {
case 'info':
return _jsx(Information, {});
case 'success':
return _jsx(Success, {});
case 'error':
return _jsx(Warning, {});
default:
return _jsx(Warning, {});
}
};
export const getBackgroundColor = (severity) => {
switch (severity) {
case 'info':
return theme.palette.alert.InfoBG;
case 'success':
return theme.palette.alert.SuccessBG;
case 'error':
return theme.palette.alert.ErrorBG;
default:
return theme.palette.alert.WarningBG;
}
};
export const getAccentColor = (severity) => {
switch (severity) {
case 'info':
return theme.palette.blue[25];
case 'success':
return theme.palette.lunitTeal[40];
case 'error':
return theme.palette.red[5];
default:
return theme.palette.yellow[20];
}
};