import { IGenericAttachments } from "../../../generic/types";
import { INiceCxoneAttachment, INiceCxoneEvent } from "../../types";

export const transformAttachments = ({ props }: IGenericAttachments): Partial<INiceCxoneEvent> => {
    const atts = props?.value?.staticValue || props?.value?.filesValue;

    const attachments: Array<INiceCxoneAttachment> = atts?.map((att) => {
        return { url: att.text };
    });

    return { attachments };
};
