summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/vue_shared/ci_action_icons.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/vue_shared/ci_action_icons.js')
-rw-r--r--app/assets/javascripts/vue_shared/ci_action_icons.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/app/assets/javascripts/vue_shared/ci_action_icons.js b/app/assets/javascripts/vue_shared/ci_action_icons.js
new file mode 100644
index 00000000000..b21f0ab49fd
--- /dev/null
+++ b/app/assets/javascripts/vue_shared/ci_action_icons.js
@@ -0,0 +1,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] || '';
+}