<script setup lang="ts">
import { RowDeleteAction } from '@/components/button';
import { useCan } from '@/composables/useCan';
import { destroy } from '@/routes/admin/hr/attendances';
import type { AttendanceListItem } from '@/types/attendance';

defineProps<{
    attendance: AttendanceListItem;
}>();

const { can } = useCan();
</script>

<template>
    <div class="flex items-center justify-end gap-1">
        <RowDeleteAction v-if="can('attendances.delete')" :action-url="destroy.url(attendance.id)" title="Hapus data presensi?"
            :description="`Presensi tanggal ${attendance.attendance_date_formatted} akan dihapus secara permanen.`"
            error-message="Gagal menghapus data presensi." />
    </div>
</template>
