The medication prescibed to you is typical for eye infection
called conjuctivitis. It is a type of infection which is localised to eye and to kill the infection this type of anti bacterial medication is given.
Since the medication you are using is used locally into the eyes only and the safety of drugs in the eye drops are not very much clear in preganacy, but the amount of medication which is going to your body can be very less and having any side effect to baby is not there.
Apart from that the medication is required only for few days till your eye condition improved.
Thanks and take care.