(function() {
const notes = document.getElementById('notesText');
const sendBtn = document.getElementById('notesSendButton');
const sendIcon = document.getElementById('sendIcon');
function updateSendState() {
const hasText = notes.value.trim().length > 0;
if (hasText) {
sendBtn.classList.remove('send-button--disabled');
sendBtn.classList.add('send-button--enabled');
sendBtn.setAttribute('aria-disabled', 'false');
if (sendIcon) sendIcon.src = 'images/send-onset.png';
} else {
sendBtn.classList.add('send-button--disabled');
sendBtn.classList.remove('send-button--enabled');
sendBtn.setAttribute('aria-disabled', 'true');
if (sendIcon) sendIcon.src = 'images/send-unset.png';
}
}
notes.addEventListener('input', updateSendState);
updateSendState();
sendBtn.addEventListener('click', function() {
if (sendBtn.classList.contains('send-button--enabled')) {
// Placeholder action for now
console.log('Notes submitted:', notes.value.trim());
notes.value = '';
updateSendState();
}
});
})();