import React, {useEffect} from "react"; import Image from "next/image"; import { useImageProxy } from "@/hooks/useImageProxy"; import { formatUnixTimestamp } from "@/utils/time"; import { Tag } from "primereact/tag"; import GenericButton from "@/components/buttons/GenericButton"; const ContentDropdownItem = ({ content, onSelect }) => { const { returnImageProxy } = useImageProxy(); return (
content thumbnail
{content.title || content.name}
{content.summary || content.description && (
{content.summary.split('\n').map((line, index) => (

{line}

))}
)}
{content.price &&
Price: {content.price}
} {content?.topics?.length > 0 && (
{content.topics.map((topic) => ( ))}
)}
{(content.published_at || content.created_at) ? `Published: ${formatUnixTimestamp(content.published_at || content.created_at)}` : "not yet published"}
onSelect(content)} className="py-2" />
); }; export default ContentDropdownItem;