@Maggimay,
So, your granddaughter (if I'm reading this right) has been pregnant for around 8 1/2 months, and no one has suggested to your daughter to seek medical attention or other assistance in quitting smoking?
Smoking is a major addiction, She probably won't get past it in about a month. Expect fits and starts. Expect setbacks. Of course it's a worthwhile goal for her to quit, and not just for this reason. But stress can make people reach for a smoke-- and now that things are down to the wire, guess what kind of pressure your daughter will be feeling?
As for your granddaughter, nice idea to not have people smoke around her kid.
And.... it's utterly impractical.
Unless she keeps her baby inside forever, inevitably they will encounter someone who smokes. That's reality.
But your granddaughter's goal is misplaced. She shouldn't want to have the baby around
smoking, not smokers. What I mean is, She needs to set a clear boundary in her home: no smoking inside, ever, and no sneaking even an outdoor cigarette more than once every 2 hours.
If your daughter wants to see the baby, she'll comply. And, every time, she'll try to make it to 2 hours. Again, expect failure and fits and starts. And your daughter should still get medical or other help.
But people who quit addictions (like drinking) are often better able to handle things by starting and keeping compliance streaks. This is why you see/hear people who say they've been 20 years sober. It's not just an accomplishment unto itself. It's also a reminder that they've done 20 years sober, so they can handle the next 20 minutes.
Imperfect? Yes. But she and the baby have a relationship and your daughter isn't punished for poor decisions she probably first made when she was still a minor. And your granddaughter learns some flexibility and empathy.
IANAD.