<script setup lang="ts">
type ClickType = 'cancel' | 'draft' | 'submit'

const emit = defineEmits<{
  (e: 'click', type: ClickType): void
}>()

function onClick(type: ClickType) {
  emit('click', type)
}
</script>

<template>
  <div class="m-2 flex gap-2 px-2">
    <Button class="bg-gray-400" type="button" @click="onClick('cancel')">
      <Icon name="i-lucide-arrow-left" class="me-2 align-middle" />
      Back
    </Button>
    <Button class="bg-orange-500" variant="outline" type="button" @click="onClick('draft')">
      <Icon name="i-lucide-file" class="me-2" />
      Edit
    </Button>
    <Button class="bg-red-500" type="button" @click="onClick('submit')">
      <Icon name="i-lucide-trash" class="me-2 align-middle" />
      Delete
    </Button>
  </div>
</template>
