[Machine] The Messenger of Allah ﷺ said, "Whoever consoles a bereaved person, he will have a reward equal to his (the bereaved person's) reward." This was specifically attributed to Ali ibn Asim, although it has also been narrated from others. And Allah knows best.
قَالَ رَسُولُ اللهِ ﷺ مَنْ عَزَّى مُصَابًا فَلَهُ مِثْلُ أَجْرِهِ تَفَرَّدَ بِهِ عَلِيُّ بْنُ عَاصِمٍ وَهُوَ أَحَدُ مَا أُنْكِرَ عَلَيْهِ وَقَدْ رُوِيَ أَيْضًا عَنْ غَيْرِهِ وَاللهُ أَعْلَمُ