2020-03-10 20:11:12 +01:00
|
|
|
import React from 'react';
|
|
|
|
|
// Icons
|
2020-03-13 03:27:48 +01:00
|
|
|
import seriesActive from './../../assets/icons/series-active.svg';
|
|
|
|
|
import seriesInactive from './../../assets/icons/series-inactive.svg';
|
2020-03-10 20:11:12 +01:00
|
|
|
import cancel from './../../assets/icons/cancel.svg';
|
|
|
|
|
import chevronDown from './../../assets/icons/chevron-down.svg';
|
|
|
|
|
import chevronRight from './../../assets/icons/chevron-right.svg';
|
|
|
|
|
import infoLink from './../../assets/icons/info-link.svg';
|
|
|
|
|
import launchArrow from './../../assets/icons/launch-arrow.svg';
|
|
|
|
|
import launchInfo from './../../assets/icons/launch-info.svg';
|
2020-03-11 00:34:09 +01:00
|
|
|
import logoOhifSmall from './../../assets/icons/logo-ohif-small.svg';
|
2020-03-13 03:27:48 +01:00
|
|
|
import magnifier from './../../assets/icons/magnifier.svg';
|
2020-03-11 00:34:09 +01:00
|
|
|
import notificationwarningDiamond from './../../assets/icons/notificationwarning-diamond.svg';
|
2020-03-10 20:11:12 +01:00
|
|
|
import settings from './../../assets/icons/settings.svg';
|
2020-03-11 00:34:09 +01:00
|
|
|
import sorting from './../../assets/icons/sorting.svg';
|
2020-03-10 20:11:12 +01:00
|
|
|
import sortingActiveDown from './../../assets/icons/sorting-active-down.svg';
|
|
|
|
|
import sortingActiveUp from './../../assets/icons/sorting-active-up.svg';
|
|
|
|
|
|
|
|
|
|
const ICONS = {
|
2020-03-13 03:27:48 +01:00
|
|
|
'series-active': seriesActive,
|
|
|
|
|
'series-inactive': seriesInactive,
|
2020-03-10 20:11:12 +01:00
|
|
|
cancel: cancel,
|
|
|
|
|
'chevron-down': chevronDown,
|
|
|
|
|
'chevron-right': chevronRight,
|
|
|
|
|
'info-link': infoLink,
|
|
|
|
|
'launch-arrow': launchArrow,
|
|
|
|
|
'launch-info': launchInfo,
|
2020-03-11 00:34:09 +01:00
|
|
|
'logo-ohif-small': logoOhifSmall,
|
2020-03-13 03:27:48 +01:00
|
|
|
magnifier: magnifier,
|
2020-03-11 00:34:09 +01:00
|
|
|
'notificationwarning-diamond': notificationwarningDiamond,
|
2020-03-10 20:11:12 +01:00
|
|
|
settings: settings,
|
|
|
|
|
'sorting-active-down': sortingActiveDown,
|
|
|
|
|
'sorting-active-up': sortingActiveUp,
|
|
|
|
|
sorting: sorting,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Return the matching SVG Icon as a React Component.
|
|
|
|
|
* Results in an inlined SVG Element. If there's no match,
|
|
|
|
|
* return `null`
|
|
|
|
|
*/
|
|
|
|
|
export default function getIcon(key, props) {
|
|
|
|
|
if (!key || !ICONS[key]) {
|
|
|
|
|
return React.createElement('div', null, 'Missing Icon');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return React.createElement(ICONS[key], props);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export { ICONS };
|