]> git.localhorst.tv Git - alttp.git/blobdiff - resources/js/helpers/Technique.js
fix tech requirements markup
[alttp.git] / resources / js / helpers / Technique.js
index 410f01595657de34f339d8c0f88b529bbdab316c..1a8f4fc91f0fe92d3bb874816340eab8d4be9ef6 100644 (file)
@@ -1,5 +1,15 @@
 import i18n from '../i18n';
 
+export const getLink = tech => {
+       if (tech.type === 'mode') {
+               return `/modes/${tech.name}`;
+       }
+       if (tech.type === 'ruleset') {
+               return `/rulesets/${tech.name}`;
+       }
+       return `/tech/${tech.name}`;
+};
+
 export const getRelations = (tech, type) => {
        const rs = (tech && tech.relations) || [];
        return type ? rs.filter(r => r && r.pivot && r.pivot.type === type) : rs;