12 lines
303 B
TypeScript

export const elementsToActions: Record<string, string> = {
btnCalculate: 'calculate',
btnCreateKP: 'create-kp',
};
export type Elements = keyof typeof elementsToActions;
export function getAction(elementName: Elements) {
const actionName = elementsToActions[elementName];
return actionName;
}