We are in process of converting our existing JS buttons to Quick Action + lightning Components.
There are some 2/3 buttons which do the same functionality with very little difference among them. For Example, Creating a case with subject field Test1 in buttonA, Test2 in button B, Test3 in button C.
So ideally i should have 3 quick actions with 3 components. But since this is a very little change, i do not want to create another new component+controller and would like to reuse 1 component for all 3.
Using the above js code, i get the modal header name (which is nothing but the quick action label).
Finally based on the value from above js, i assign value to the field in sObject.
Is this correct approach or is there any predefined function which can be used for getting the quick action name?