Plans to transform a former primary school near Bishop Auckland into business units and a community hub have been approved.