<script lang="ts">
  import { Button } from '$lib/components/ui/button'
  import type { Approval } from '$lib/api'

  let {
    row,
    deciding = null,
    onApprove,
    onDeny
  }: {
    row: Approval
    deciding?: string | null
    onApprove?: (id: string) => void
    onDeny?: (id: string) => void
  } = $props()
</script>

<div class="flex justify-end gap-2">
  <Button size="sm" disabled={deciding === row.id} onclick={() => onApprove?.(row.id)}
    >Approve</Button
  >
  <Button
    size="sm"
    variant="destructive"
    disabled={deciding === row.id}
    onclick={() => onDeny?.(row.id)}>Deny</Button
  >
</div>
