--- import markdownToText from "@helpers/markdownToText"; import { Card } from "./card"; import { useTranslatedPath, useTranslations } from "@i18n/utils"; import Image from "@components/Image.astro"; interface Props { post: { data: { title: string; icon?: string; headerImg?: string; }; collection: string; slug: string; body: string; }; } const { data: { title, headerImg, icon }, collection, body, slug, } = Astro.props.post; const translatePath = useTranslatedPath(Astro.url); const t = useTranslations(Astro.url); const imagePath = `../content/${collection}/${slug.split("/")[0]}/${headerImg}`; const image = headerImg && (await import(imagePath)).default; const link = translatePath(`/${collection}/${slug.split("/")[0]}`); --- {icon && } {title} {markdownToText(body).slice(0, 200)} { image?.format && ( {"cover ) }