0 ? content.titles[0].pre_title : undefined
}
diff --git a/src/pages/contents/[slug]/read.tsx b/src/pages/contents/[slug]/read.tsx
index 6ef51ed..c770ebf 100644
--- a/src/pages/contents/[slug]/read.tsx
+++ b/src/pages/contents/[slug]/read.tsx
@@ -162,7 +162,7 @@ export default function ContentRead(props: ContentReadProps): JSX.Element {
/>
0 ? content.titles[0].pre_title : undefined
}
diff --git a/src/pages/news/[slug].tsx b/src/pages/news/[slug].tsx
index 3abc4c3..3a7334a 100644
--- a/src/pages/news/[slug].tsx
+++ b/src/pages/news/[slug].tsx
@@ -12,7 +12,7 @@ import SubPanel from "components/Panels/SubPanel";
import RecorderChip from "components/RecorderChip";
import ToolTip from "components/ToolTip";
import { getPost, getPostsSlugs } from "graphql/operations";
-import { GetPostQuery } from "graphql/operations-types";
+import { GetPostQuery, StrapiImage } from "graphql/operations-types";
import { GetStaticPaths, GetStaticProps } from "next";
import { useRouter } from "next/router";
import { AppStaticProps, getAppStaticProps } from "queries/getAppStaticProps";
@@ -27,6 +27,13 @@ export default function LibrarySlug(props: PostProps): JSX.Element {
const { post, postId, langui } = props;
const router = useRouter();
+ const thumbnail: StrapiImage | undefined =
+ post.translations.length > 0 && post.translations[0].thumbnail.data
+ ? post.translations[0].thumbnail.data.attributes
+ : post.thumbnail.data
+ ? post.thumbnail.data.attributes
+ : undefined;
+
const subPanel = (
0 && post.translations[0].thumbnail.data
- ? post.translations[0].thumbnail
- : post.thumbnail
- }
+ thumbnail={thumbnail}
title={
post.translations.length > 0
? post.translations[0].title
@@ -120,7 +123,7 @@ export default function LibrarySlug(props: PostProps): JSX.Element {
}
contentPanel={contentPanel}
subPanel={subPanel}
- thumbnail={post.translations[0].thumbnail.data?.attributes}
+ thumbnail={thumbnail}
{...props}
/>
);