@onereach/channel-transformer
Version:
Convert data model between different channels (Slack, Microsoft Teams, Generic...)
20 lines (16 loc) • 421 B
text/typescript
import { IGenericSection, IGenericInput } from '../../../generic/types';
import { IInputText } from '../../types';
export const transformInputText = (msg: IInputText): IGenericSection => {
const result: IGenericSection = {
type: 'section',
children: []
};
const input: IGenericInput = {
type: 'input',
props: {
label: msg.label
}
};
result.children.push(input);
return result;
};