It is both.
Social isolation does cause depression and anxiety, as social interaction is a very well proven anti-depressant.
Covid is also known to destroy your sense of smell. The olfactory bulb. which is neural tissue in your nose, goes right into your brain, and has no protection from blood brain barrier...because it doesn't have it.
Covid is neurotoxic. Isolation does cause depression. Both are true.