import { IGenericAttachments } from "../../../generic/types";
import { SMSAttachment } from "../../types";

export const transformFileUpload = (attachments: Array<SMSAttachment>): IGenericAttachments => {
    const result: IGenericAttachments = {
        type: "attachments",
        props: {
            value: {
                staticValue: attachments.map(attachment => {
                    return {
                        text: attachment.linkURL || attachment.location
                    };
                })
            }
        }
    };

    return result;
};
