707
}
708
case 'blob': {
710
return undefined;
711
}
713
>
const displayKind = readSimpleAttachmentDisplayKindFromMimeType(attachment.mimeType);
714
>
return {
715
>
type: MessageAttachmentKind.Simple,
716
>
label: attachment.displayName ?? 'attachment',
717
>
modelRepresentation: decodeBase64(attachment.data ?? '').toString(),
718
>
...(displayKind !== undefined ? { displayKind } : {}),
719
>
};
720
>
}
721
>
const displayKind = attachment.mimeType.startsWith('image/') ? 'image' : undefined;
722
>
return {
723
>
type: MessageAttachmentKind.EmbeddedResource,
724
>
label: attachment.displayName ?? 'attachment',
725
>
data: attachment.data ?? '',
726
>
contentType: attachment.mimeType,
727
>
displayKind,
728
>
};
729
>
}
730
default:
731
return undefined;