"use client";
import useNetworks from "@/hooks/useNetworks";

interface DeleteNetworkProps {
    networkId: string;
}

export default function DeleteNetwork({ networkId }: DeleteNetworkProps) {
    const { deleteNetwork } = useNetworks();

    return (
        <div>
            <dialog id="delete_network" className="modal">
                <div className="modal-box w-2/3 max-w-2/3">
                    <h3 className="text-lg font-bold">Delete Network</h3>
                    <p className="py-4">Are you sure you want to delete this network?</p>
                    <div className="modal-action">
                        <form method="dialog">
                            <button className="btn">Cancel</button>
                            <button className="btn btn-primary" onClick={() => deleteNetwork(networkId)}>Delete</button>
                        </form>
                    </div>
                </div>
            </dialog>
        </div>
    );
}