The Messenger of Allah ﷺ used to command us to bring out the unmarried young women, the menstruating women, and the women in seclusion. As for the menstruating women, they would stay away from the prayer area but witness the good and the supplication along with the Muslims.
حدثنا حسين بن محمد حدثنا جرير يعني ابن حازم عن محمد
كان رسول الله ﷺ يأمرنا أن نخرج العواتق والحيض وذوات الخدور فأما الحيض فيعتزلن المصلى ويشهدن الخير والدعوة مع المسلمين