summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/vue_shared/ci_action_icons.js
blob: b21f0ab49fd0ae3d6ae4731a6374587fd09ea8e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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';

/**
 * For the provided action returns the respective SVG
 *
 * @param  {String} action
 * @return {SVG|String}
 */
export default function getActionIcon(action) {
  const icons = {
    icon_action_cancel: cancelSVG,
    icon_action_play: playSVG,
    icon_action_retry: retrySVG,
    icon_action_stop: stopSVG,
  };

  return icons[action] || '';
}