const actionOnEnter = (fn: () => void) => (e: React.KeyboardEvent) => {
if (e.target instanceof HTMLElement) {
console.log(e.target.nodeName); // Safely access nodeName
}
if (e.key === "Enter") {
e.preventDefault();
fn();
}
};