Files
KLC-Website-Frontend/src/components/CTABannerSection.tsx

101 lines
3.4 KiB
TypeScript
Raw Normal View History

2025-08-28 13:14:51 +05:30
import { ArrowRight } from "lucide-react";
import { ImageWithFallback } from "./figma/ImageWithFallback";
import { BrandedTag } from "./about/BrandedTag";
import { PrimaryCTAButton } from "./PrimaryCTAButton";
import { navigateTo } from "./Router";
2026-03-20 19:43:27 +05:30
interface CTABannerSectionProps {
2026-03-27 12:43:34 +05:30
ctaSection?: {
2026-03-20 19:43:27 +05:30
id: string;
background_image_url: string;
text: string;
cta_text: string;
cta_destination: string;
2026-03-27 12:43:34 +05:30
description: string;
landing_page_type: string;
service_type: string | null;
};
2026-03-20 19:43:27 +05:30
isLoading?: boolean;
}
2026-03-27 12:43:34 +05:30
export function CTABannerSection({ ctaSection, isLoading }: CTABannerSectionProps) {
2026-03-20 19:43:27 +05:30
if (isLoading) {
return (
<section className="relative h-[700px] overflow-hidden bg-gray-100 animate-pulse">
<div className="absolute inset-0 bg-gray-200" />
<div className="relative h-full flex items-center justify-end section-margin-x">
<div className="bg-gray-300 rounded-lg p-16 max-w-2xl w-full h-96" />
</div>
</section>
);
}
2026-03-27 12:43:34 +05:30
// If no CTA section data is available, don't render anything
if (!ctaSection) {
2026-03-20 19:43:27 +05:30
return null;
}
2025-08-28 13:14:51 +05:30
return (
<section className="relative h-[700px] overflow-hidden">
{/* Background Image */}
<div className="absolute inset-0">
<ImageWithFallback
2026-03-27 12:43:34 +05:30
src={ctaSection.background_image_url || "https://images.unsplash.com/photo-1552664730-d307ca884978?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=2940&q=80"}
alt="Background image for call to action section"
2025-08-28 13:14:51 +05:30
className="w-full h-full object-cover"
/>
{/* Subtle dark overlay for overall image */}
<div className="absolute inset-0 bg-black/30" />
{/* Gradient overlay for better text readability */}
<div className="absolute inset-0 bg-gradient-to-r from-black/20 via-transparent to-black/60" />
</div>
{/* Content Container */}
<div className="relative h-full flex items-center justify-end section-margin-x">
{/* CTA Content Block */}
<div
className="bg-opacity-95 backdrop-blur-sm rounded-lg p-16 max-w-2xl"
style={{
backgroundColor: 'var(--color-brand-primary)'
}}
>
{/* Branded Tag */}
<BrandedTag text="Next Steps" variant="white" />
2026-03-27 12:43:34 +05:30
{/* Main Headline */}
2025-08-28 13:14:51 +05:30
<h2
2026-03-27 12:43:34 +05:30
className="text-h2-white mb-4"
2025-08-28 13:14:51 +05:30
>
2026-03-27 12:43:34 +05:30
{ctaSection.text || "Ready to transform your leadership?"}
2025-08-28 13:14:51 +05:30
<span
className="italic"
style={{ color: 'var(--color-brand-accent)' }}
>
{" "}Get in touch{" "}
</span>
to start your development journey now.
</h2>
2026-03-27 12:43:34 +05:30
{/* Description */}
{ctaSection.description && (
<p
className="text-body-white mb-6 opacity-90"
>
{ctaSection.description}
</p>
)}
2026-03-20 19:43:27 +05:30
{/* CTA Button */}
2025-08-28 13:14:51 +05:30
<PrimaryCTAButton
2026-03-27 12:43:34 +05:30
text={ctaSection.cta_text || "Schedule a Consultation"}
onClick={() => navigateTo(ctaSection.cta_destination || '/contact?topic=consulting')}
2025-08-28 13:14:51 +05:30
ariaLabel="Schedule a consultation with our leadership experts"
className="cta-banner-yellow"
/>
</div>
</div>
</section>
);
}