array reduce for component