diff options
Diffstat (limited to 'app/assets/javascripts/content_editor/components/wrappers/label.vue')
-rw-r--r-- | app/assets/javascripts/content_editor/components/wrappers/label.vue | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/app/assets/javascripts/content_editor/components/wrappers/label.vue b/app/assets/javascripts/content_editor/components/wrappers/label.vue new file mode 100644 index 00000000000..4206c866032 --- /dev/null +++ b/app/assets/javascripts/content_editor/components/wrappers/label.vue @@ -0,0 +1,34 @@ +<script> +import { NodeViewWrapper } from '@tiptap/vue-2'; +import { GlLabel } from '@gitlab/ui'; +import { isScopedLabel } from '~/lib/utils/common_utils'; + +export default { + name: 'DetailsWrapper', + components: { + NodeViewWrapper, + GlLabel, + }, + props: { + node: { + type: Object, + required: true, + }, + }, + computed: { + isScopedLabel() { + return isScopedLabel({ title: this.node.attrs.originalText }); + }, + }, +}; +</script> +<template> + <node-view-wrapper class="gl-display-inline-block"> + <gl-label + size="sm" + :scoped="isScopedLabel" + :background-color="node.attrs.color" + :title="node.attrs.text" + /> + </node-view-wrapper> +</template> |