How utterly dreadful, your poor friend.
I lost my 18 year old son nearly a year ago. Very little helps as it is the worse thing you will ever have to experience. Be there for her, talk about her daughter.
Don't tell her there was a reason for this - no reason can make this any better.
Don't tell her time will heal. Time does not heal, we just learn to live alongside our grief.
Don't tell her she can have more children - she might not be able to and any future children will never replace a lost child.
Don't tell her she will get over this. She won't. Ever.
Remember her daughters birthday and the anniversary of her death. Remember your friend on her birthday, Mother's Day, Christmas, every Sunday when most families have a family day.
Hold her. Cry with her. Tell her you love her. Tell her you love her daughter and will never forget her. Agree with her this is the most terrible thing to have happened, do not try to minimise anything.
Send her texts with no expectations of answers. Just tell her you are thinking of her. Often. Child loss is a very isolating, solitary journey and we need to know that there are strong friends who will walk alongside us for some parts of it.