Would you consider applying for your Maternity leave now before you finish work. You must be within 16 weeks of your due date, so if you are 21 weeks now and you have 4 weeks left at work your application could be made during your last working week. You would therefore be starting your maternity leave on the first day of your unemployment.
Other option is to go on jobseekers benefit as you seem to be looking for employment and if you are not successful you would be allowed(I think) to remain on jobseekers benefit for the same number of weeks as Maternity Benefit covers without the obligation to seek work. Check with Social Welfare
Maternity Leave is the number of weeks you are entitled to take off work(26 weeks)
Maternity Benefit is the State Benefit you receive while you are off