I was in hospital on IV antibiotics when my DC 2 was 4 months old. It was an unexpected emergency admission (sudden severe breathing difficulties, although it turned out I'd probably had bronchitis for some time without knowing) so no preparation time unfortunately.
My baby wasn't allowed to come with me and wouldn't have been allowed to breastfeed due to the specific antibiotics not being safe.
My husband had to buy bottles and formula and give him his first ever formula - luckily he took it without issue ... less luckily never having used formula he fed him 12 oz in one feed as I'd always breasted on demand and dc2 finished the first bottle and was looking for more - he was already off the charts size wise on breastmilk 

I pumped while in hospital - my milk was green once the antibiotics were in my system so I am glad I wasn't breastfeeding while on them!
I can't remember exactly how long after coming off the IV I had to wait before my milk was safe again as it was 13 years ago, but I think 48 hours.
We were lucky and had a seemless transition back to breastfeeding - 3 or 4 months is old enough for them to usually be able to swap between the two, but its not guaranteed obviously.
My dc2 had formula for about 6 or 7 days in total and went back to exclusively breastfeeding from then until weaned onto food at 6 months (and no formula then, but obviously solid food as well as breastmilk).
It doesn't have to be the end of breastfeeding.
My experience had nothing to do with covid-19.