import Link from 'next/link'; interface WhyChooseUsProps { data: { heading: string; highlightWord?: string; subheading: string; description: string; mainImage?: string; secondaryImage?: string; items: { icon: string; title: string; description: string; }[]; features: string[]; ctaButton: { label: string; href: string; }; }; } const WhyChooseUs = ({ data }: WhyChooseUsProps) => { const highlight = data.highlightWord?.trim(); let headingContent: React.ReactNode = data.heading; if (highlight) { const index = data.heading.indexOf(highlight); if (index !== -1) { const before = data.heading.slice(0, index); const after = data.heading.slice(index + highlight.length); headingContent = ( <> {before} {highlight} {after} > ); } } return ( {data.subheading} {headingContent} {data.description} {data.items.map((item, index) => ( {item.title}- {item.description} ))} {data.features.map((feature, index) => ( {feature} ))} {data.ctaButton.label} ); }; export default WhyChooseUs;
{data.description}
{item.description}