Macbook Air recognizes battery while starting, but later says "no battery available" (battery icon X)
Unfortunately, intermittent battery connection failures can also be a result of spilling water on the computer.  It's not just a case of either it works or not.

You'll need to take the computer in to a service center. The technician will likely try swapping out the battery first to see if that does the trick. Otherwise, you might be looking at a full logic board replacement.