The Messenger of Allah ﷺ forbade buying and selling and the recitation of poetry in the mosques.
حدثنا عبد الله بن سعيد الكندي حدثنا أبو خالد الأحمر عن ابن عجلان
نهى رسول الله ﷺ عن البيع والابتياع وعن تناشد الأشعار في المساجد
[Its isnad is hasan] Abu Dawud narrated it in Al-Salat, chapter on sitting in circles on Friday before the prayer, no. 1079, from the hadith of Ibn Ajlan, and Tirmidhi graded it hasan, no. 322. Ibn Ajlan explicitly stated that he heard it directly, as recorded by Ahmad.