import { GetContentQuery, GetWebsiteInterfaceQuery, } from "graphql/operations-types"; import { prettyinlineTitle, prettySlug, slugify } from "queries/helpers"; import Img, { ImageQuality } from "components/Img"; import InsetBox from "components/InsetBox"; import Chip from "components/Chip"; export type ThumbnailHeaderProps = { pre_title?: string; title: string; subtitle?: string; description?: string; type?: GetContentQuery["contents"]["data"][number]["attributes"]["type"]; categories?: GetContentQuery["contents"]["data"][number]["attributes"]["categories"]; thumbnail?: GetContentQuery["contents"]["data"][number]["attributes"]["thumbnail"]["data"]["attributes"]; langui: GetWebsiteInterfaceQuery["websiteInterfaces"]["data"][number]["attributes"]; }; export default function ThumbnailHeader( props: ThumbnailHeaderProps ): JSX.Element { const { langui, pre_title, title, subtitle, thumbnail, type, categories, description, } = props; return ( <>
{thumbnail ? ( ) : (
)}

{pre_title}

{title}

{subtitle}

{type && type.data && (

{langui.type}

{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} ))}
)}
{description && {description}} ); }