"use client"
import { Button } from "@/components/ui/button"
import { Trash2 } from "lucide-react"
import { type cf_api_keys } from "@prisma/client"

export function DeleteApiKeyButton({
  deleteDialog,
  rowToDelete,
  setRowTodelete,
}: {
  deleteDialog: (open: boolean) => void
  rowToDelete: cf_api_keys | null
  setRowTodelete: (key: cf_api_keys | null) => void
}): JSX.Element {
  return (
    <Button
      className="icon"
      variant="ghost"
      type="submit"
      onClick={() => {
        setRowTodelete(rowToDelete)
        deleteDialog(true)
      }}
    >
      <Trash2 size={12} />
    </Button>
  )
}
