Leave, better sooner than later. Your health is more important.
I have been in a similar situation where I stayed too long.
Eventually I took some time off, did other things. After a while you get your energy back. Take your time.
Take care of yourself. Get some exercise, even just walking outside.
The fact you solved their biggest issue will always look good on your resume and during interviews. Also I believe you're hired to fix these problems; it's part of your job. So even though it impacts the business a lot it doesn't mean you're entitled to something. If you can't accept that, doing the same great work will be hard to do in your next jobs.