As long as you're careful to practice self care and know your limits and make sure you don't get too personally involved, which is easy to do if you really feel you understand what the person is going through. Talk to people if things are getting too much as it can get overwhelming in a job like that. There's no reason you can't do a good job despite your own mental health issues, I work in a setting with vulnerable people, many with mental health problems, and despite struggling at the moment I manage find, I can shut off my own 'stuff' when I need to in order to properly support people.