Sugar?

I’m so into chocolate and sweets in general. It’s been very hard but since I found out I was pregnant I’ve been eating much healthier, lots of veggies and good things. How bad is it to indulge in an ice cream or cookies or candy? Could it hurt the baby?