import { TextType } from '../../../generic/types';
import { IGenericText } from '../../../generic/types';

export const transformText = (text: string, textType?: TextType): IGenericText => {
  const result: IGenericText = {
    type: 'text',
    props: {
      value: text,
      ...(textType && { type: textType })
    }
  };

  return result;
};