<script>
import { mapState, mapActions } from 'vuex';
import { GlButton } from '@gitlab/ui';
import Icon from '~/vue_shared/components/icon.vue';

export default {
  components: {
    GlButton,
    Icon,
  },
  props: {
    rule: {
      type: Object,
      required: true,
    },
  },
  computed: {
    ...mapState(['settings']),
  },
  methods: {
    ...mapActions(['requestEditRule', 'requestDeleteRule']),
  },
};
</script>

<template>
  <div>
    <gl-button @click="requestEditRule(rule)">
      <span>{{ __('Edit') }}</span>
    </gl-button>
    <gl-button
      class="gl-ml-3 btn btn-inverted"
      variant="danger"
      category="primary"
      @click="requestDeleteRule(rule)"
    >
      <icon name="remove" :aria-label="__('Remove')" />
    </gl-button>
  </div>
</template>
