If it runs while connected to the AC adapter but won’t charge. You most likely need a new battery.
Try to find one with a ton of good reviews and 4 star average on Amazon. Not all batteries are made the same. Better yet contact the manufacturer for an OEM battery.