Microscopic theory of the γ decay of nuclear giant resonances