Clustering, glass transition and gelation in a reactive fluid