summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/vue_shared/components/todo_button.vue
blob: 935d222a1a98b1836e179faf78417c3da333689d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<script>
import { GlButton } from '@gitlab/ui';
import { __ } from '~/locale';

export default {
  components: {
    GlButton,
  },
  props: {
    isTodo: {
      type: Boolean,
      required: false,
      default: true,
    },
  },
  computed: {
    buttonLabel() {
      return this.isTodo ? __('Mark as done') : __('Add a to do');
    },
  },
};
</script>

<template>
  <gl-button v-bind="$attrs" :aria-label="buttonLabel" @click="$emit('click', $event)">
    {{ buttonLabel }}
  </gl-button>
</template>