import React from "react"; import Image from "next/image"; import { ReactMarkdown } from "@/components/Markdown"; interface ContextItemProperties { item: { name: string; url: string; description: string; provider: { name: string; image?: { thumbnail: { contentUrl: string; }; }; }[]; datePublished: string; image?: { contentUrl: string; thumbnail: { contentUrl: string; width: number; height: number }; }; }; } const ContextItem: React.FC = ({ item }) => { return (
{/* div for image if the link does not exist use the placeholder image */} {!item.image && ( {"placeholder"} )} {item.image && {item.name}}
{/* div for other text info */}

{item.name}

{/* Content container with controlled overflow */}
{/* Absolute positioned provider info */}
{item.provider[0].image && ( {`${item.provider[0].name} )} {item.provider[0].name} {new Date(item.datePublished).toLocaleDateString()}
); }; export default ContextItem;