"use client"; import React, { useState } from "react"; import ContextItem from "./ContextItem"; interface ContextItemType { 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; }; }; article?: string; score?: number; } interface ExpandableItemsProperties { context: ContextItemType[]; } const ExpandableItems: React.FC = ({ context }) => { const [expanded, setExpanded] = useState(false); const handleShowMore = () => { setExpanded(!expanded); }; return (
{expanded && context.slice(1).map((item, index) => (
))}
); }; export default ExpandableItems;