Danville and Pittsylvania County officials approved a purchase agreement for the megasite to an entity tied to data center development.