import { Inertia } from "@inertiajs/inertia"; import React, { useState } from "react"; const DeleteButton = ({ isOpen, onClose, item, tableName }) => { if (!isOpen || !item) return null const handleDelete = () => { Inertia.post(`/delete${tableName}/${item.id}`, { onSuccess: () => { onClose(); }, }) } return (
Apakah Anda yakin ingin menghapus {item.nama}?