<script setup lang="ts">
import { Check } from '@lucide/vue';
import { Button } from '@/components/ui/button';
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip';

defineProps<{
    tooltip?: string;
    disabled?: boolean;
    size?: 'default' | 'sm';
}>();

defineEmits(['click']);
</script>

<template>
    <Tooltip>
        <TooltipTrigger as-child>
            <Button variant="ghost" :size="size === 'sm' ? 'sm' : 'icon'"
                :class="size === 'sm' ? '' : 'size-8'" class="text-green-600 hover:text-green-700" :disabled="disabled"
                @click="$emit('click')">
                <Check :class="size === 'sm' ? 'size-3.5' : 'size-4'" />
                <span class="sr-only">{{ tooltip || 'Setujui' }}</span>
            </Button>
        </TooltipTrigger>
        <TooltipContent>{{ tooltip || 'Setujui' }}</TooltipContent>
    </Tooltip>
</template>
