interface SingleNewProps {
	date: string;
	title: string;
	labels: string[];
	content: string;
	acf?: Record<string, any>;
	featuredImageUrl: string; // Include featured image URL in props
}

const SingleNew: React.FC<SingleNewProps> = ({
												 date,
												 title,
												 labels,
												 content,
												 acf,
												 featuredImageUrl,
											 }) => {
	return (
		<div className="single-new">
			<img src={featuredImageUrl} alt="Featured" />
			<div className="single-new__header">
				<div className="single-new__date">{date}</div>
				<div className="single-new__labels">
					{labels.map((label, index) => (
						<span key={index}>{label}</span>
					))}
				</div>
			</div>
			<h3 className="single-new__title">{title}</h3>
			<div
				className="single-new__content"
				dangerouslySetInnerHTML={{ __html: content }}
			/>
			{acf && (
				<div className="single-new__acf">
					{/* Render all ACF fields dynamically */}
					{Object.entries(acf).map(([key, value]) => (
						<div key={key}>
							<strong>{key}: </strong>
							{value}
						</div>
					))}
				</div>
			)}
		</div>
	);
};

export default SingleNew;
