The Messenger of Allah ﷺ said, "There is a kind of jealousy that Allah loves and a kind that Allah detests, and there is a kind of pride that Allah loves and a kind that Allah detests. The jealousy that Allah loves is jealousy when there is just cause for suspicion, and the jealousy that Allah detests is jealousy when there is no cause for suspicion. The pride that Allah loves is a servant's pride in himself for Allah's sake during battle, and his pride when giving charity. The pride that Allah detests is pride shown in boasting and arrogance," or something close to what the Messenger of Allah ﷺ said.
حدثنا إسماعيل حدثنا الحجاج بن أبي عثمان حدثنا يحيى بن أبي كثير عن محمد بن إبراهيم أن
قال رسول الله ﷺ إن من الغيرة ما يحب الله ومنها ما يبغض الله ومن الخيلاء ما يحب الله ومنها ما يبغض الله فالغيرة التي يحب الله الغيرة في الريبة والغيرة التي يبغض الله الغيرة في غير ريبة والخيلاء التي يحب الله اختيال العبد بنفسه لله عند القتال واختياله بالصدقة والخيلاء التي يبغض الله الخيلاء في الفخر والكبر أو كالذي قال رسول الله ﷺ