import React from 'react'; import { Link } from 'react-router-dom'; // FIX: PageComponent will be imported from types after the type definition is added. import { Business, PageComponent } from '../types'; import { SERVICES } from '../mockData'; const RenderComponent: React.FC<{ component: PageComponent }> = ({ component }) => { switch (component.type) { case 'HEADING': { // FIX: Replaced dynamic JSX tag with React.createElement to fix parsing errors. const tag = `h${component.content?.level || 1}`; const className = `font-bold text-gray-900 dark:text-white my-4 ${ component.content?.level === 1 ? 'text-4xl' : component.content?.level === 2 ? 'text-2xl' : 'text-xl' }`; return React.createElement(tag, { className }, component.content?.text); } case 'TEXT': return
{component.content?.text}
; case 'IMAGE': return{service.description}