debian-mirror-gitlab/app/assets/javascripts/vue_shared/ci_action_icons.js

22 lines
561 B
JavaScript
Raw Normal View History

2017-08-17 22:00:37 +05:30
import cancelSVG from 'icons/_icon_action_cancel.svg';
import retrySVG from 'icons/_icon_action_retry.svg';
import playSVG from 'icons/_icon_action_play.svg';
import stopSVG from 'icons/_icon_action_stop.svg';
2017-09-10 17:25:29 +05:30
/**
* For the provided action returns the respective SVG
*
* @param {String} action
* @return {SVG|String}
*/
2017-08-17 22:00:37 +05:30
export default function getActionIcon(action) {
2017-09-10 17:25:29 +05:30
const icons = {
icon_action_cancel: cancelSVG,
icon_action_play: playSVG,
icon_action_retry: retrySVG,
icon_action_stop: stopSVG,
};
2017-08-17 22:00:37 +05:30
2017-09-10 17:25:29 +05:30
return icons[action] || '';
2017-08-17 22:00:37 +05:30
}