From 580415f98a951727ea7b0909fd546df7276f97a0 Mon Sep 17 00:00:00 2001 From: pradeepkumar Date: Sun, 12 Apr 2026 16:18:54 +0530 Subject: [PATCH] refactor: conditionally render description and helper text in HeroSection based on content availability --- src/components/home/HeroSection.tsx | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/components/home/HeroSection.tsx b/src/components/home/HeroSection.tsx index 3eda651..849c5d2 100644 --- a/src/components/home/HeroSection.tsx +++ b/src/components/home/HeroSection.tsx @@ -9,9 +9,9 @@ import type { HeroContent } from '@/types/cms'; const defaultHeroContent: HeroContent = { headline: '\u201cDiscover verified, top-rated real estate professionals to guide your buying, selling, or investing journey.\u201d', - description: 'Discover verified, top-rated real estate professionals', + description: '', ctaButtonText: 'See All', - helperText: 'Connect with trusted local agents to explore homes, compare options, and make smarter decisions.', + helperText: '', }; export function HeroSection({ content }: { content?: HeroContent }) { @@ -128,9 +128,11 @@ export function HeroSection({ content }: { content?: HeroContent }) {

{data.headline}

-

- {data.description} -

+ {data.description && ( +

+ {data.description} +

+ )} {/* Search Form */} @@ -270,9 +272,11 @@ export function HeroSection({ content }: { content?: HeroContent }) { {/* Helper Text */} -

- {data.helperText} -

+ {data.helperText && ( +

+ {data.helperText} +

+ )}