Probing the randomness of ergodic states: extreme-value statistics in the ergodic and many-body-localized phases