[![enter image description here](https://i.stack.imgur.com/sB1Vv.png)](https://i.stack.imgur.com/sB1Vv.png)

If $\theta$ is the maximum angle for the pendulum's swing, then should $T\cos\theta=mg$ or should $T=mg\cos\theta$.

I think that the components must be done in the perpendicular directions $T\cos\theta=mg$ as the bob can't go any further. Can anybody please help me by telling me what would be the correct choice?