<script setup lang="ts">
import Button from '~/components/pub/ui/button/Button.vue'

const props = defineProps<{
  rec: any
  idx?: number
}>()

// Try to get proses handler from parent via inject
const prosesHandler = inject<(rec: any) => void>('proses-handler', null)

function handleProses() {
  if (prosesHandler) {
    prosesHandler(props.rec)
  }
}
</script>

<template>
  <div class="flex justify-center">
    <Button
      type="button"
      class="border-orange-500 bg-orange-500 text-white hover:bg-orange-600"
      @click="handleProses"
    >
      Proses
    </Button>
  </div>
</template>

