Maternity leave

Have any of you ladies taken maternity leave 2 months prior to due date? (Canada). Was it worth it? I feel like my brain fog is bad, making me feel dumb at work. I have anxiety with messing up with work and people judging. Still feeling a bit sad and unmotivated at work. Thoughts?