diff --git a/packages/app/src/components/PostCard/index.jsx b/packages/app/src/components/PostCard/index.jsx
index f4ee64d2..85e443cc 100644
--- a/packages/app/src/components/PostCard/index.jsx
+++ b/packages/app/src/components/PostCard/index.jsx
@@ -107,101 +107,92 @@ export function PostHeader(props) {
}
-export const PostAdditions = React.memo((props) => {
- let { additions } = props
-
- let carruselRef = React.useRef(null)
-
- // fullfil url string additions
- additions = additions.map((addition) => {
- if (typeof addition === "string") {
- addition = {
- url: addition,
- }
- }
-
- return addition
- })
-
- // then filter if has an valid url
- additions = additions.filter(addition => /^(http|https):\/\//.test(addition.url))
-
- additions = additions.map((addition, index) => {
- const { url, id, name } = addition
-
- const MediaRender = loadable(async () => {
- let extension = null
-
- try {
- // get media type by parsing the url
- const mediaTypeExt = /\.([a-zA-Z0-9]+)$/.exec(url)
-
- if (mediaTypeExt) {
- extension = mediaTypeExt[1]
- } else {
- // try to get media by creating requesting the url
- const response = await fetch(url, {
- method: "HEAD",
- })
-
- extension = response.headers.get("content-type").split("/")[1]
+export class PostAdditions extends React.PureComponent {
+ getAdditions = (data) => {
+ return data.map((addition, index) => {
+ if (typeof addition === "string") {
+ addition = {
+ url: addition,
}
+ }
- extension = extension.toLowerCase()
+ const { url, id, name } = addition
- const mediaType = mediaTypes[extension]
- const mimeType = `${mediaType}/${extension}`
+ const MediaRender = loadable(async () => {
+ let extension = null
- if (!mediaType) {
+ try {
+ // get media type by parsing the url
+ const mediaTypeExt = /\.([a-zA-Z0-9]+)$/.exec(url)
+
+ if (mediaTypeExt) {
+ extension = mediaTypeExt[1]
+ } else {
+ // try to get media by creating requesting the url
+ const response = await fetch(url, {
+ method: "HEAD",
+ })
+
+ extension = response.headers.get("content-type").split("/")[1]
+ }
+
+ extension = extension.toLowerCase()
+
+ const mediaType = mediaTypes[extension]
+ const mimeType = `${mediaType}/${extension}`
+
+ if (!mediaType) {
+ return () =>
+ }
+ case "video": {
+ return () =>
+ }
+ case "audio": {
+ return () =>
+ }
+
+ default: {
+ return () =>