the way the game is set up turns this into a "clickable icon", look at the Battlemaster Fighter moves.
They are all clickable things on the hotbar, seperate from basic attacks.

in that case i htink divine smite will work the same, you declare smite BEFORE the attack.

Imagine how cumbersome itd be otherwise, everytime you would attck the game would pause and ask you if you want to smite