@social-mail/social-mail-client 1.2.619 → 1.2.621

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@social-mail/social-mail-client",
3
- "version": "1.2.619",
3
+ "version": "1.2.621",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -5,14 +5,32 @@ export default function MediaCarousel({ email = void 0 as IEmail}) {
5
5
  if (!email.attachments?.length) {
6
6
  return <div/>;
7
7
  }
8
- return <carousel-slider>
9
- { ... email.attachments.map((x) => /image/i.test(x.contentType)
10
- ? <img src={x.downloadUrl} />
11
- : (/video/i.test(x.contentType)
12
- && <video
13
- controls="true"
14
- src={x.downloadUrl}/>
15
- )
16
- )}
17
- </carousel-slider>;
8
+ // const cs = <carousel-slider>
9
+ // { ... email.attachments.map((x) => /image/i.test(x.contentType)
10
+ // ? <img src={x.downloadUrl} />
11
+ // : (/video/i.test(x.contentType)
12
+ // && <video
13
+ // controls="true"
14
+ // src={x.downloadUrl}/>
15
+ // )
16
+ // )}
17
+ // </carousel-slider>;
18
+
19
+ const children = [] as XNode[];
20
+
21
+ for (const element of email.attachments) {
22
+ if (element.contentID) {
23
+ continue;
24
+ }
25
+ if (/video/i.test(element.contentType)) {
26
+ children.push(<video controls="true" src={element.downloadUrl} />);
27
+ continue;
28
+ }
29
+ if (/image/i.test(element.contentType)) {
30
+ children.push(<img src={element.downloadUrl} />);
31
+ continue;
32
+ }
33
+ }
34
+
35
+ return XNode.create("carousel-slider", {}, children);
18
36
  }