I wish I could think of some sort of amazingly helpful thoughts. But all that comes to my mind is that if every baby born was born into an ideal situation, there wouldn't be very many people on earth. Your grandchild might actually motivate your daughter to be more emotionally mature. I have seen it happen to young women a number of times - I could hardly believe it, but there it was.
As for the father, well...I have seen slackers become terrific dads - and I have seen the opposite.
If you can, try to allow this pregnancy to be hers, be her responsibility. I know how very difficult that can be (I have a daughter, 34, and a son, 31 - neither plan on having children and I desperately want a grandchild, only their careers...oh, the irony...).
Do bear in mind that you will most likely fall in love with that baby when it is born. A new baby, in my experience, always brings new hope and wonderment.