<script setup lang="ts">
import { RowAdjustAction } from '@/components/button';
import { useCan } from '@/composables/useCan';
import type { PayrollListItem } from '@/types/payroll';

defineProps<{
    payroll: PayrollListItem;
}>();

const emit = defineEmits<{
    adjust: [payroll: PayrollListItem];
}>();

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

<template>
    <div class="flex items-center justify-end gap-1">
        <RowAdjustAction v-if="payroll.can_adjust && can('payroll.adjust')" tooltip="Sesuaikan Gaji"
            @click="emit('adjust', payroll)" />
    </div>
</template>
