UNPKG

@onereach/channel-transformer

Version:

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

10 lines (8 loc) 442 B
import { IGenericList } from "../../../../generic/types"; import { IRWCAnswerComponent } from '../../../types'; import { RWCAnswerComponent } from '../../../classes/v5'; export const transformList = ({props}: IGenericList): IRWCAnswerComponent => { const options = props?.options.map(({value, label} )=> ({value, label})); const result = {options, ...props.rwc}; return new RWCAnswerComponent(result, 'rwc-reorderable-list'); };