The company pulled the plug on a $6.5B battery deal, pointing to cooling EV demand and the impact of new US government policy