import { useState, useEffect, useCallback } from "react";
import axios from "axios";
import { Network } from "@/app/types";

const useNetworks = () => {
   
    const addNetwork = (network: Network) => {
        axios.post('/api/sites/networks/add', network);
    };

    const editNetwork = (network: Network) => {
        axios.post('/api/sites/networks/edit', network);
    };

    const deleteNetwork = (networkId: string) => {
        axios.delete('/api/sites/networks/delete', {
            params: { networkId }
        });
    };

    return {
        addNetwork,
        editNetwork,
        deleteNetwork,
    };
};

export default useNetworks;