<template>
  <component
    :is="component"
    class="pui-tag"
    :class="[type, size, {
      'is-secondary': secondary,
      'control': control
    }]"
    @click="$emit('click')"
  >
    <slot />
  </component>
</template>

<script>
export default {
  name: "PTag",
  props: {
    type: String,
    size: String,
    secondary: Boolean,
    control: Boolean,
  },
  computed: {
    component() {
      return this.control ? 'a' : 'span'
    }
  }
}
</script>