Get transform controls for Directional and spot lights dynamically

Hello,

I have a situation and I want to add transform controls for directional light and spot lights dynamically as they are clicked. I had to pick light helpers to detect a click through Raycaster. It seems fine with point light but I’m finding it difficult to attach controls to spot and direction lights.

Here is the link for codepen https://codepen.io/abnormalcoder/pen/dyydLVq

I don’t know click events are not working in modules, I had to use modules as transformcontrols file is not working in traditional way.

I see that Point light has type of Mesh and Spot Light and Direction Light has type of Object3D

anyway to achieve transform controls for lights as in threejs editor?

any help yet?