Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:4:38

And ˹also˺ those who spend of their wealth to be seen by the people and believe not in Allah nor in the Last Day. And he to whom Satan is a companion - then evil is he as a companion.  

And those (wa’lladhīna, a supplement to the previous alladhīna, ‘those’) who expend of their substance to show off to people, to be seen of them, and believe not in God and the Last Day, the likes of the hypocrites and the Meccans. Whoever has Satan for a comrade, for a companion, whose command he follows, as these do, then an evil comrade has he.
القرآن:٤:٣٨

وَالَّذِينَ يُنْفِقُونَ أَمْوَالَهُمْ رِئَاءَ النَّاسِ وَلَا يُؤْمِنُونَ بِاللَّهِ وَلَا بِالْيَوْمِ الْآخِرِ ۗ وَمَنْ يَكُنِ الشَّيْطَانُ لَهُ قَرِينًا فَسَاءَ قَرِينًا  

{والذين} عطف على الذين قبله {ينفقون أموالهم رئاء الناس} مرائين لهم {ولا يؤمنون بالله ولا باليوم الآخر} كالمنافقين وأهل مكة {ومن يكن الشيطان له قرينا} صاحبا يعمل بأمره كهؤلاء {فساء} بئس {قرينا} هو.