UNPKG

@onereach/channel-transformer

Version:

Convert data model between different channels (Slack, Microsoft Teams, Generic...)

20 lines (17 loc) 479 B
import { IGenericSection, IGenericLink } from '../../../generic/types'; import { IOutputLink } from '../../types'; import { transformText } from './text'; export const transformOutputLink = (msg: IOutputLink): IGenericSection => { const link: IGenericLink = { type: 'link', props: { url: msg.value.action }, children: [transformText(msg.label)] }; const result: IGenericSection = { type: 'section', children: [link] }; return result; };