<template>
  <PButton @click.stop="$emit('click', item)">
    <span v-if="text">{{ text }}</span>
    <VIcon v-if="icon" class="ma-auto">{{ icon }}</VIcon>
  </PButton>
</template>

<script>
import PButton from '../../PButton/PButton'
import { defineComponent } from '@vue/composition-api'

export default defineComponent({
  name: 'ButtonRenderer',
  components: { PButton },
  props: {
    item: {
      type: Object,
      required: true,
    },
    icon: {
      type: String,
      required: false,
    },
    text: {
      type: String,
      required: false,
    },
  },
  emits: ['click'],
})
</script>
