summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/members/components/action_buttons/leave_button.vue
blob: 443a962e0cfd26e0ed54f42608728f583320e044 (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
29
30
31
32
33
34
35
36
37
38
39
40
<script>
import { GlButton, GlModalDirective, GlTooltipDirective } from '@gitlab/ui';
import { __ } from '~/locale';
import LeaveModal from '../modals/leave_modal.vue';
import { LEAVE_MODAL_ID } from '../../constants';

export default {
  name: 'LeaveButton',
  title: __('Leave'),
  modalId: LEAVE_MODAL_ID,
  components: {
    GlButton,
    LeaveModal,
  },
  directives: {
    GlModal: GlModalDirective,
    GlTooltip: GlTooltipDirective,
  },
  props: {
    member: {
      type: Object,
      required: true,
    },
  },
};
</script>

<template>
  <div>
    <gl-button
      v-gl-tooltip.hover
      v-gl-modal="$options.modalId"
      :title="$options.title"
      :aria-label="$options.title"
      icon="leave"
      variant="danger"
    />
    <leave-modal :member="member" />
  </div>
</template>