<template>
  <div class="rt-button--center">
    <rt-button type="sub" text :click="click">
      <template v-if="hasIcon">
        <slot name="icon" />
      </template>
      <span>{{text}}</span>
    </rt-button>
  </div>
</template>

<script>
export default {
  name: 'rtButtonCenter',
  props: {
    click: Function,
    text: {
      type: String,
      required: true
    }
  },
  computed: {
    hasIcon() {
      return this.$slots.icon;
    }
  }
};
</script>
