import Chip from "components/Chip"; import Img from "components/Img"; import InsetBox from "components/InsetBox"; import Markdawn from "components/Markdown/Markdawn"; import { GetContentQuery, UploadImageFragment } from "graphql/generated"; import { AppStaticProps } from "graphql/getAppStaticProps"; import { prettyinlineTitle, prettySlug, slugify } from "helpers/formatters"; import { ImageQuality } from "helpers/img"; import { Immutable } from "helpers/types"; interface Props { pre_title?: string | null | undefined; title: string | null | undefined; subtitle?: string | null | undefined; description?: string | null | undefined; type?: Exclude< Exclude< GetContentQuery["contents"], null | undefined >["data"][number]["attributes"], null | undefined >["type"]; categories?: Exclude< Exclude< GetContentQuery["contents"], null | undefined >["data"][number]["attributes"], null | undefined >["categories"]; thumbnail?: UploadImageFragment | null | undefined; langui: AppStaticProps["langui"]; languageSwitcher?: JSX.Element; } export default function ThumbnailHeader(props: Immutable): JSX.Element { const { langui, pre_title, title, subtitle, thumbnail, type, categories, description, languageSwitcher, } = props; return ( <>
{thumbnail ? ( ) : (
)}

{pre_title}

{title}

{subtitle}

{type?.data?.attributes && (

{langui.type}

{type.data.attributes.titles && type.data.attributes.titles.length > 0 ? type.data.attributes.titles[0]?.title : prettySlug(type.data.attributes.slug)}
)} {categories && categories.data.length > 0 && (

{langui.categories}

{categories.data.map((category) => ( {category.attributes?.name} ))}
)} {languageSwitcher}
{description && ( {} )} ); }