You can either spend your time generating prompts, tweaking them until you get what you want and then using more prompts to refining the code until you end up with something that does what you want...
or you can just fucking write it yourself. And there's the bonus of understanding how it works.
AI is probably fine for generating boiler plate code or repetitive simple stuff, but personally I wouldn't trust it any further than that.