document.getElementById("testerNameInput").addEventListener("change", handleSet);
document.getElementById("terterNameErase").addEventListener("click", handleErase);

function handleSet(e) {
    e.preventDefault()
    const testerName = document.getElementById("testerNameInput").value
    if (!testerName) {
        return
    }

    sendMessage({
        kind: "changeTesterName",
        testerName
    })
    .then(response => {
        if (response) {
            getState();
        }
    });
}

function handleErase(e) {
    e.preventDefault()

    sendMessage({
        kind: "changeTesterName",
        testerName: ""
    })
    .then(response => {
        if (response) {
            getState();
        }
    });
}
