diff --git a/src/components/AboutUs.tsx b/src/components/AboutUs.tsx index ec0c2cb..682af19 100644 --- a/src/components/AboutUs.tsx +++ b/src/components/AboutUs.tsx @@ -1,92 +1,39 @@ -import { useState, useEffect } from 'react'; -import { motion } from 'motion/react'; import { - Target, - Users, - Globe, - Lightbulb, - ArrowRight, - CheckCircle, - Star, - Award, - Brain, - TrendingUp, - Shield, - Heart, - Zap, - Eye, BookOpen, + Brain, + CheckCircle, + Heart, Puzzle, - Building, - ArrowLeft + Shield, + Target, + TrendingUp, + Users, + Zap } from 'lucide-react'; -import { BrandedTag } from './about/BrandedTag'; -import { PrimaryCTAButton } from './PrimaryCTAButton'; -import { CTABannerSection } from './CTABannerSection'; -import { TestimonialsSection } from './TestimonialsSection'; -import { TeamMemberModal } from './TeamMemberModal'; -import { navigateTo } from './Router'; -import { Button } from './ui/button'; +import { motion } from 'motion/react'; +import { useEffect, useState } from 'react'; +import Aparna from '../assets/Aparna-Nair.png'; +import Balaji from '../assets/Balaji-Chandrakumar.jpeg'; +import Diju from '../assets/Diju.jpeg'; import Ramkumar from '../assets/K-Ramkumar.png'; import Muralidharan from '../assets/R-Muralidharan.png'; -import Aparna from '../assets/Aparna-Nair.png'; -import Swaminathan from '../assets/v-Swaminathan.jpg'; -import Balaji from '../assets/Balaji-Chandrakumar.jpeg'; import Ramesh from '../assets/Ramesh-Padmanabhan.jpeg'; -import Diju from '../assets/Diju.jpeg'; +import Swaminathan from '../assets/v-Swaminathan.jpg'; import svgPaths from '../imports/svg-kw7r0ellyk'; import { useGetAboutUsQuery } from '../redux/services/aboutUsApi'; +import { BrandedTag } from './about/BrandedTag'; +import { CTABannerSection } from './CTABannerSection'; +import { PrimaryCTAButton } from './PrimaryCTAButton'; +import { navigateTo } from './Router'; +import { TeamMemberModal } from './TeamMemberModal'; +import { TestimonialsSection } from './TestimonialsSection'; +import { Button } from './ui/button'; +import { FullScreenLoader } from './FullScreenLoader'; -// Leadership Orientations Data -const leadershipOrientations = [ - { name: 'Thinking', icon: Brain, description: 'Strategic and analytical mindset' }, - { name: 'Risk Appetite', icon: TrendingUp, description: 'Calculated risk-taking approach' }, - { name: 'Power', icon: Shield, description: 'Authority and influence dynamics' }, - { name: 'Interpersonal/Political', icon: Users, description: 'Relationship and network building' }, - { name: 'Ambition', icon: Target, description: 'Drive for achievement and growth' }, - { name: 'Trust', icon: Heart, description: 'Building confidence and reliability' }, - { name: 'Learning', icon: BookOpen, description: 'Continuous development mindset' }, - { name: 'Nurturance', icon: Heart, description: 'Supporting and developing others' }, - { name: 'Result/Closure', icon: CheckCircle, description: 'Focus on outcomes and completion' } -]; -// Our Uniqueness Data -const uniquenessPoints = [ - { - icon: Target, - title: 'Context & Strategy Alignment', - description: 'We align our work to the client\'s specific context & strategy' - }, - { - icon: BookOpen, - title: 'Research-Anchored Approach', - description: 'Our work is anchored on research and work of scholars' - }, - { - icon: Users, - title: 'Client-Specific Needs', - description: 'We blend this with the specific needs of the client' - }, - { - icon: Puzzle, - title: 'Co-Creation Process', - description: 'We co-create the design with our clients' - } -]; - -// Benefits Data -const benefits = [ - 'We use proprietary exercises, custom written cases, curated films and proprietary tools', - 'Facilitate insights on the connect between one\'s leadership orientations and their leadership abilities', - 'We create learning at an individual level and at a group level', - 'Our designs focus on application and practice', - 'We bring in the connect of the learning to the Business contexts', - 'We recommend that the Leadership intervention is designed for a period of 12-15 months with multiple touch points which can constitute a combination of classroom, fire side chats, one-on-one sessions, address by an expert, use of profilers, accessing online content on concepts and accomplished leaders\' experiences' -]; - -// Team Members Data with Full Profiles (Static - can be kept or also fetched from API if needed) -const staticTeamMembers = [ - { +// Static detailed team member data for modal +const staticTeamMembersDetails = { + 'Mr. K Ramkumar': { name: 'Mr. K Ramkumar', role: 'Managing Director', image: Ramkumar, @@ -109,12 +56,12 @@ He co-created the ICICI Manipal Academy for Banking and Insurance, which inducte 'Executive Director on ICICI Bank Board', 'Created ICICI Manipal Academy (12,000 leaders trained)', 'Founded ICICI Academy for Skills (35,000+ youth skilled)', - 'Author of “Leveraging Human Capital” (McGraw Hill)' + 'Author of "Leveraging Human Capital" (McGraw Hill)' ], clientWork: 'Guided leadership development across ICICI Group and worked with Manipal Global Education to groom future banking leaders.', boardRoles: 'Former Board Member of ICICI Prudential Life, ICICI Ventures; served on CSR and leadership committees.' }, - { + 'Mr. R. Muralidharan': { name: 'Mr. R. Muralidharan', role: 'Practice Head – Leadership Development', image: Muralidharan, @@ -140,7 +87,7 @@ At ICICI Bank, he was part of the founding team in 1994 and rose to become GM clientWork: 'Worked with public and private banks, financial services firms, and non-profits on leadership and customer service transformation.', boardRoles: 'Held board positions in business and non-profits; Vice-Chair, Customer Service Excellence Foundation.' }, - { + 'Ms. Aparna Nair': { name: 'Ms. Aparna Nair', role: 'Practice Head – Leadership Development', image: Aparna, @@ -166,7 +113,7 @@ She is certified in MBTI and OPQ, has applied Balanced Scorecard frameworks, and clientWork: 'Worked with Godrej & Boyce, ICICI Prudential, Citi WAI, WNS, ThyssenKrupp, and others across pharma, BFSI, retail, auto, and private equity.', boardRoles: 'Independent Woman Director; held leadership positions at ICICI Bank and Blue Dart-FedEx.' }, - { + 'Mr. V. Swaminathan': { name: 'Mr. V. Swaminathan', role: 'Practice Head – Leadership Development', image: Swaminathan, @@ -192,7 +139,7 @@ He stepped down as Joint President of Kotak Mahindra Bank in 2021 before joining clientWork: 'Extensive work with BFSI organizations and leadership development initiatives at scale.', boardRoles: 'Key member of Kotak’s Management Committee; contributor to strategic boards within Kotak divisions.' }, - { + 'Mr. Balaji Chandrakumar': { name: 'Mr. Balaji Chandrakumar', role: 'Practice Head – Leadership Development', image: Balaji, @@ -218,7 +165,7 @@ Earlier, he worked in consulting with top Indian firms and began his HR journey clientWork: 'Worked with leading companies in telecom, food, and HR consulting sectors across India and SE Asia.', boardRoles: 'Advisor in HR capability building across organizations.' }, - { + 'Mr. Ramesh Padmanabhan': { name: 'Mr. Ramesh Padmanabhan', role: 'Practice Head – Leadership Development', image: Ramesh, @@ -244,7 +191,7 @@ He has consistently worked on capability building and leadership development alo clientWork: 'Significant work in BFSI sector; tailored leadership development for managers and executives.', boardRoles: 'Served on MANCOM and strategic boards in ICICI, Dhanlaxmi, and ADCB India.' }, - { + 'Ms. Diju S': { name: 'Ms. Diju S', role: 'Practice Head – Leadership Development', image: Diju, @@ -270,41 +217,68 @@ After a career break, she joined KLC as Practice Head. She now co-creates leader clientWork: 'Worked with BFSI clients and KLC partners to create custom leadership programs.', boardRoles: 'Active in leadership forums and project management at KLC.' } -]; +}; -// Loading Skeleton Component -const AboutUsSkeleton = () => ( -
- {/* Hero Section Skeleton */} -
-
-
-
-
-
-
-
-
-
-
-
- - {/* Add more skeleton sections as needed */} -
Loading...
-
-); +// Helper function to get member details by name +const getMemberDetails = (nameRole: string) => { + // Extract the name from "Name - Role" format + const name = nameRole.split(' - ')[0]; + return staticTeamMembersDetails[name as keyof typeof staticTeamMembersDetails] || null; +}; export function AboutUs() { const [isVisible, setIsVisible] = useState(false); const [expandedValue, setExpandedValue] = useState('context'); - const [selectedMember, setSelectedMember] = useState(null); + const [selectedMember, setSelectedMember] = useState(null); const [isModalOpen, setIsModalOpen] = useState(false); // Fetch About Us data from API const { data: aboutUsData, isLoading, isError, error } = useGetAboutUsQuery(); - const handleMemberClick = (member: typeof staticTeamMembers[0]) => { - setSelectedMember(member); + const transformTestimonials = (apiTestimonials: any[]) => { + if (!apiTestimonials || apiTestimonials.length === 0) return []; + + return apiTestimonials.map((testimonial, index) => ({ + id: testimonial.id || index, + name: testimonial.name || "Anonymous", + role: testimonial.designation || "Client", + company: undefined, + avatar: testimonial.profile_photo_url || undefined, + image: testimonial.profile_photo_url || undefined, + quote: testimonial.content || "", + rating: 5, + isVideo: !!testimonial.video_url, + videoThumbnail: testimonial.video_thumbnail_url || testimonial.profile_photo_url, + videoUrl: testimonial.video_url || undefined + })); + }; + + // Transform the testimonials + const testimonialsData = transformTestimonials(aboutUsData?.testimonials || []); + + // Get team members from API + const apiTeamMembers = aboutUsData?.our_team || []; + + const handleMemberClick = (member: any) => { + // Get detailed static data for the clicked member + const memberDetails = getMemberDetails(member.name_role); + if (memberDetails) { + setSelectedMember(memberDetails); + } else { + // Fallback to API data if no static details found + setSelectedMember({ + name: member.name_role.split(' - ')[0], + role: member.name_role.split(' - ')[1] || 'Team Member', + image: member.photo_url, + experience: member.bio, + fullBio: member.bio, + expertise: [], + education: '', + achievements: [], + clientWork: '', + boardRoles: '' + }); + } setIsModalOpen(true); }; @@ -361,12 +335,14 @@ export function AboutUs() { }; }, []); - // Show loading skeleton while fetching data if (isLoading) { - return ; + return ( +
+ +
+ ); } - // Show error state if API call fails if (isError) { return (
@@ -460,7 +436,6 @@ export function AboutUs() {

{aboutUsData?.how_we_work_title || "How We Work"}

- {/* Four Key Points Grid - Using API data if available, otherwise fallback to static */}
{(aboutUsData?.how_we_work && aboutUsData.how_we_work.length > 0) ? ( aboutUsData.how_we_work.map((item, index) => ( @@ -492,7 +467,6 @@ export function AboutUs() { )) ) : ( - // Fallback to static data if API data is not available <> - {/* Split Layout - Left: Eyebrow Text, Right: Main Heading */}
- {/* Left Side - Eyebrow Text */}
@@ -612,7 +584,6 @@ export function AboutUs() {
- {/* Right Side - Main Heading */}

- {/* Updated Statistics Grid - Dynamic from API */}
{(aboutUsData?.stat_section && aboutUsData.stat_section.length > 0) ? ( aboutUsData.stat_section.map((stat, index) => ( @@ -650,7 +620,6 @@ export function AboutUs() { )) ) : ( - // Fallback to static statistics if API data is not available <> - {/* Section 4: Our Team - Dynamic from API */} + {/* Section 4: Our Team - Dynamic from API (outer grid from API, modal from static) */}
- {/* Centered Header Section */} {aboutUsData?.our_team_title || "Our Team"}

- We have a team of 7 consultants and 4 young consultants. All our senior Consultants are ex-business professionals with experience ranging from 15-30 years in varied business functions and carry a deep understanding of the area they are engaging in. Two of them bring in Board room experience. – Meet them + {aboutUsData?.our_team_description || "We have a team of 7 consultants and 4 young consultants. All our senior Consultants are ex-business professionals with experience ranging from 15-30 years in varied business functions and carry a deep understanding of the area they are engaging in. Two of them bring in Board room experience. – Meet them"}

- {/* Team Members Grid - Using static team members with full profiles */} + {/* Team Members Grid - Using API data for outer display */}
- {staticTeamMembers.map((member, index) => ( - handleMemberClick(member)} - > -
-
- {member.name} -
+ {apiTeamMembers.map((member, index) => { + const name = member.name_role.split(' - ')[0]; + const role = member.name_role.split(' - ')[1] || 'Team Member'; - {/* Hover Overlay */} -
-
-
- View Profile -
-
-
-
- -
-

{member.name}

-

- {member.role} -

-
-
- ))} -
- - {/* Alternative: Use API team data if needed */} - {/* {aboutUsData?.our_team && aboutUsData.our_team.length > 0 && ( -
- {aboutUsData.our_team.map((member, index) => ( + return ( handleMemberClick(member)} >
{member.alt_text} { + (e.target as HTMLImageElement).src = 'https://ui-avatars.com/api/?name=' + encodeURIComponent(name) + '&background=04045B&color=fff&size=200'; + }} />
+
+
-

- {member.name_role.split(' - ')[0]} -

-

- {member.name_role.split(' - ')[1] || ''} +

{name}

+

+ {role} +

+ {/* Bio Section */} +

+ {member.bio || "No bio available"}

-

{member.bio}

- ))} -
- )} */} -
-
-
- - {/* Section 5: Our Methodology (Static - unchanged) */} -
-
-
- - -

Our Methodology

-
- - {/* Vertical Timeline Container */} -
- {/* Vertical Line Background - Gray - Ends exactly at Phase 3 dot */} -
- - {/* Vertical Line Fill - Blue - Animated on Scroll */} -
- - {/* Phase 1 - Understanding & Assessment */} -
-
- {/* Phase dot positioned absolutely */} -
- - {/* Column 1: Phase Label */} -
-
-
- Phase 1 -
-
- - {/* Column 2: Main Heading */} -
- -

Understanding & Assessment

-
-
- - {/* Column 3: Content - Description and Bullet Points */} -
- -

- We believe that leadership is more than skill and style. Leadership is predicated by a person's orientations (typical behaviors) which shapes the leadership abilities and its fit to a context. The broader the fit of the orientation the more versatile a person is in his exercise of leadership in a variety of contexts. -

- -
-

Key Focus Areas:

- -
-
-
- - Leadership orientations (typical behaviors) assessment. - -
- -
-
- - Action-consequence model application. - -
- -
-
- - Context alignment and strategy integration. - -
-
-
-
-
-
-
- - {/* Phase 2 - Development & Practice */} -
-
- {/* Phase dot positioned absolutely */} -
- - {/* Column 1: Phase Label */} -
-
-
- Phase 2 -
-
- - {/* Column 2: Main Heading */} -
- -

Development & Practice

-
-
- - {/* Column 3: Content - Description and Bullet Points */} -
- -

- Thus, in our engagements with our clients we work with the individual using the action-consequence model to link up one's leadership orientations (typical behaviors) to outcomes. -

- -

- Leadership is a social skill. Socially aware people shape the thought, emotions and actions of others better. The key to social-awareness is self-awareness. We help our learners become aware, gain insights and discover their fullest leadership potential. This in turn builds organizational leadership capacity & capabilities. -

- -
-

Development Process:

- -
-
-
- - Self-awareness and insight facilitation. - -
- -
-
- - Leadership potential discovery sessions. - -
- -
-
- - Organizational capacity building. - -
-
-
-
-
-
-
- - {/* Phase 3 - Implementation & Mastery */} -
-
- {/* Phase dot positioned absolutely */} -
- - {/* Column 1: Phase Label */} -
-
-
- Phase 3 -
-
- - {/* Column 2: Main Heading */} -
- -

Implementation & Mastery

-
-
- - {/* Column 3: Content - Description and Bullet Points */} -
- -

- Our approach to learning works on the 'Orientation Toning process', which is using 'Restraint and Release' of thought, emotions and actions. This release is moderated according to the demands of a context, without being tied down by one's default settings. -

- -
-

Mastery Framework:

- -
-
-
- - Orientation Toning process implementation. - -
- -
-
- - Context-responsive leadership adaptation. - -
- -
-
- - Sustainable behavior change integration. - -
-
-
-
-
-
-
- - {/* Our Philosophy - Full Width Figma Design */} -
- {/* Phase dot positioned absolutely */} -
- -
- -
-
- {/* Left Section: Heading */} -
-

Our Philosophy

-
- - {/* Right Section: Content */} -
- {/* Philosophy Description */} -

- Our philosophy is that leadership begins with orientations — the inner drivers and behaviors that shape who we are. These orientations combine to create leadership abilities, which in turn lead to meaningful outcomes. At Kautilya Leadership Centre, we see leadership as a journey of connecting orientations to abilities and outcomes through structured development. -

- - {/* Three Philosophy Items */} -
- {/* Leadership Orientations */} -
-
- - - - - - -
-
-

- Leadership Orientations -

-

- Who am I? (inner drivers & behaviors) -

-
-
- - {/* Leadership Abilities */} -
-
- - - - - - -
-
-

- Leadership Abilities -

-

- What I can do (competencies & skills) -

-
-
- - {/* Leadership Outcomes */} -
-
- - - - - - -
-
-

- Leadership Outcomes -

-

- What I deliver (results for self & organization) -

-
-
-
-
-
-
-
-
-
- - - navigateTo('/contact')} - ariaLabel="Contact us to design your leadership journey" - className="cta-text-black" - /> - + ); + })}
+ {/* Section 5: Our Methodology - Dynamic from API */} + {aboutUsData?.methodology && ( +
+
+
+ + + {aboutUsData.methodology.subtitle && ( +

{aboutUsData.methodology.subtitle}

+ )} +
+ +
+
+ +
+ + {[...(aboutUsData.methodology.phases || [])] + .sort((a, b) => (a.display_order || 0) - (b.display_order || 0)) + .map((phase, phaseIndex) => ( +
+
+
+ +
+
+
+ {phase.phase_label || `Phase ${phase.phase_number}`} +
+
+ +
+ +

{phase.title}

+
+
+ +
+ +

+ {phase.description} +

+ + {phase.bullet_title && phase.bullets && phase.bullets.length > 0 && ( +
+

{phase.bullet_title}

+
+ {phase.bullets.map((bullet, bulletIndex) => ( +
+
+ + {bullet} + +
+ ))} +
+
+ )} +
+
+
+
+ ))} + + {aboutUsData?.philosophy && ( +
+
+ +
+ +
+
+
+

{aboutUsData.philosophy.title || "Our Philosophy"}

+
+ +
+

+ {aboutUsData.philosophy.description} +

+ + {aboutUsData.philosophy.points && aboutUsData.philosophy.points.length > 0 && ( +
+ {aboutUsData.philosophy.points.map((point, pointIndex) => ( +
+
+ + + + + + +
+
+

+ {point} +

+
+
+ ))} +
+ )} +
+
+
+
+
+
+ )} + + + navigateTo('/contact')} + ariaLabel="Contact us to design your leadership journey" + className="cta-text-black" + /> + +
+
+
+
+ )} + {/* Testimonials Section */} - {/* CTA Banner Section */} - - - {/* Team Member Modal */} -
); diff --git a/src/components/CTABannerSection.tsx b/src/components/CTABannerSection.tsx index 5f995ca..f1c6dd9 100644 --- a/src/components/CTABannerSection.tsx +++ b/src/components/CTABannerSection.tsx @@ -5,21 +5,20 @@ import { PrimaryCTAButton } from "./PrimaryCTAButton"; import { navigateTo } from "./Router"; interface CTABannerSectionProps { - ctaBands?: Array<{ + ctaSection?: { id: string; background_image_url: string; - background_image_alt_text: string; text: string; cta_text: string; cta_destination: string; - }>; + description: string; + landing_page_type: string; + service_type: string | null; + }; isLoading?: boolean; } -export function CTABannerSection({ ctaBands = [], isLoading }: CTABannerSectionProps) { - // Get the first CTA band or use default values - const ctaBand = ctaBands && ctaBands.length > 0 ? ctaBands[0] : null; - +export function CTABannerSection({ ctaSection, isLoading }: CTABannerSectionProps) { if (isLoading) { return (
@@ -31,8 +30,8 @@ export function CTABannerSection({ ctaBands = [], isLoading }: CTABannerSectionP ); } - // If no CTA band is available, don't render anything - if (!ctaBand) { + // If no CTA section data is available, don't render anything + if (!ctaSection) { return null; } @@ -41,8 +40,8 @@ export function CTABannerSection({ ctaBands = [], isLoading }: CTABannerSectionP {/* Background Image */}
@@ -65,11 +64,11 @@ export function CTABannerSection({ ctaBands = [], isLoading }: CTABannerSectionP {/* Branded Tag */} - {/* Main Headline - Use API text or fallback */} + {/* Main Headline */}

- {ctaBand.text || "Ready to transform your leadership?"} + {ctaSection.text || "Ready to transform your leadership?"} + {/* Description */} + {ctaSection.description && ( +

+ {ctaSection.description} +

+ )} + {/* CTA Button */} navigateTo(ctaBand.cta_destination || '/contact?topic=consulting')} + text={ctaSection.cta_text || "Schedule a Consultation"} + onClick={() => navigateTo(ctaSection.cta_destination || '/contact?topic=consulting')} ariaLabel="Schedule a consultation with our leadership experts" className="cta-banner-yellow" /> - - {/* Supporting Text */} -

- Connect with our leadership experts to discuss your organization's specific development needs. -

diff --git a/src/components/CartPopup.tsx b/src/components/CartPopup.tsx index 0af25b0..e092316 100644 --- a/src/components/CartPopup.tsx +++ b/src/components/CartPopup.tsx @@ -14,21 +14,22 @@ export interface CartItem { originalPrice?: string; category: string; level: string; + type?: string; } interface CartPopupProps { isOpen: boolean; onClose: () => void; - cartItems: CartItem[]; // Legacy prop - no longer used but kept for backward compatibility - onRemoveItem: (itemId: string) => void; // Legacy prop - no longer used but kept for backward compatibility + // cartItems: CartItem[]; // Legacy prop - no longer used but kept for backward compatibility + // onRemoveItem: (itemId: string) => void; // Legacy prop - no longer used but kept for backward compatibility recentlyAddedItem?: CartItem | null; } export function CartPopup({ isOpen, onClose, - cartItems: legacyCartItems, // Renamed to avoid confusion - onRemoveItem: legacyOnRemoveItem, // Renamed to avoid confusion + // cartItems: legacyCartItems, // Renamed to avoid confusion + // onRemoveItem: legacyOnRemoveItem, // Renamed to avoid confusion recentlyAddedItem }: CartPopupProps) { const [showSuccess, setShowSuccess] = useState(false); diff --git a/src/components/CourseCard.tsx b/src/components/CourseCard.tsx index 280ebea..42def13 100644 --- a/src/components/CourseCard.tsx +++ b/src/components/CourseCard.tsx @@ -1,9 +1,9 @@ import React from 'react'; import { Button } from './ui/button'; import { Badge } from './ui/badge'; -import { - Users, - Clock, +import { + Users, + Clock, Star, ArrowRight, ShoppingCart @@ -22,7 +22,7 @@ export interface Course { level: string; format: string; rating: number; - participants: string; + reviews: string; category: string; description: string; price: string; @@ -47,7 +47,7 @@ export function CourseCard({ course, onClick, className, onAddToCart }: CourseCa const handleAddToCart = (e: React.MouseEvent) => { e.stopPropagation(); // Prevent card click when clicking Add to Cart - + if (onAddToCart) { const cartItem: CartItem = { id: course.id, @@ -75,7 +75,7 @@ export function CourseCard({ course, onClick, className, onAddToCart }: CourseCa className="w-full h-full object-cover group-hover:scale-105 transition-transform duration-300" />
-
-
- - {course.level} - -
- + {/* Card Content - Reduced horizontal padding */}
{/* Course Title */} -

{course.title}

- + {/* Course Description - Limited to 2 lines with ellipsis */} -

{course.description}

- + {/* Course Meta Information - Reduced bottom margin */}
-
- - {course.participants} + {course.reviews}
- +
-
- {course.originalPrice && ( - )}
- {course.originalPrice && ( + {/* {course.originalPrice && (
- )} + )} */}
- + {/* Action Buttons - Horizontal Layout with reduced gap */}
- {/* Add to Cart Button - Outline Blue */} + {/* Add to Cart */} - - {/* Learn More Button - Solid Blue */} + + {/* Learn More */}
); -} \ No newline at end of file +} diff --git a/src/components/KautilyaFacility.tsx b/src/components/KautilyaFacility.tsx index 9e5f968..307aeea 100644 --- a/src/components/KautilyaFacility.tsx +++ b/src/components/KautilyaFacility.tsx @@ -43,111 +43,263 @@ import { Wifi } from 'lucide-react'; import { TestimonialsSection } from './TestimonialsSection'; +import { FullScreenLoader } from './FullScreenLoader'; +import { useGetServiceListQuery } from '../redux/services/sercicesApi'; -const targetAudience = [ - { - title: "Corporate Training Teams", - description: "Organizations seeking premium residential learning experiences for their leadership development programs", - icon: Building, - challenges: ["Facility booking complexity", "Quality accommodation needs", "Program logistics", "Cost management"] - }, - { - title: "Leadership Development Providers", - description: "Training organizations and consultancies requiring world-class facilities for executive programs", - icon: Users, - challenges: ["Facility availability", "Technology requirements", "Catering quality", "Professional environment"] - }, - { - title: "Executive Teams & Boards", - description: "Senior leadership teams planning strategic retreats and intensive development programs", - icon: Target, - challenges: ["Privacy requirements", "Executive-level facilities", "Strategic planning spaces", "Convenience needs"] - } -]; +// Types based on API response (same as LeadershipDevelopment) +interface ServicePageData { + hero_section: { + id: string; + landing_page_type: string; + background_image_url: string; + background_image_alt_text: string; + headline: string; + subtext: string; + cta_text: string; + cta_destination: string; + }; + overview: { + id: string; + title: string; + description: string; + highlight_text: string; + overview_cards: Array<{ + id: string; + title: string; + description: string; + icon_url: string; + accessible_label: string; + }>; + }; + audience_section: { + id: string; + title: string; + description: string; + audience_cards: Array<{ + id: string; + title: string; + description: string; + icon_url: string; + accessible_label: string; + challenges: string[]; + }>; + }; + use_case_section: { + id: string; + title: string; + description: string; + use_case_cards: Array<{ + id: string; + title: string; + description: string; + icon_url: string; + accessible_label: string; + highlight_text: string; + }>; + }; + approach_section: { + id: string; + title: string; + description: string; + approach_cards: Array<{ + id: string; + title: string; + description: string; + icon_url: string; + accessible_label: string; + bullets: string[]; + }>; + outcomes: Array<{ + id: string; + title: string; + description: string; + icon_url: string; + accessible_label: string; + bullets: string[]; + }>; + }; + stats_section: { + id: string; + title: string; + description: string; + stat_cards: Array<{ + id: string; + value: string; + label: string; + icon_url: string; + accessible_label: string; + }>; + }; + program_section: { + id: string; + title: string; + description: string; + program_phases: Array<{ + phase: { + id: string; + phase_number: number; + title: string; + duration: string; + }; + activities: Array<{ + id: string; + phase_id: string; + text: string; + }>; + outcomes: Array<{ + id: string; + phase_id: string; + text: string; + }>; + }>; + }; + impact_section: { + id: string; + title: string; + description: string; + impact_stats: Array<{ + id: string; + value: string; + description: string; + label: string; + icon_url: string; + accessible_label: string; + }>; + impact_benefits: Array<{ + id: string; + title: string; + description: string; + icon_url: string; + accessible_label: string; + }>; + }; + testimonial_section: Array<{ + id: string; + profile_xid: string; + name: string; + designation: string; + content: string; + video_url: string | null; + display_order: number; + }>; + cta_section: { + id: string; + background_image_url: string; + text: string; + cta_text: string; + cta_destination: string; + description: string; + landing_page_type: string; + service_type: string; + }; +} -const useCases = [ - { - title: "Leadership Residential Programs", - description: "When organizations need premium facilities for multi-day leadership development programs", - icon: Home, - scenario: "Executive development programs requiring 2-7 day residential experiences" - }, - { - title: "Strategic Planning Retreats", - description: "When leadership teams need focused environments for strategic planning and decision-making", - icon: Target, - scenario: "Board meetings, strategic sessions, or executive team planning retreats" - }, - { - title: "Learning & Development Events", - description: "When organizations require professional venues for training, workshops, and development events", - icon: BookOpen, - scenario: "Corporate training programs, workshops, or learning conferences" - }, - { - title: "Team Building & Culture Events", - description: "When teams need inspiring environments for team building and cultural development activities", - icon: Heart, - scenario: "Team building events, culture workshops, or organizational celebrations" - } -]; +// Map API icons to Lucide icons (same mapping as LeadershipDevelopment) +const getIconComponent = (iconUrl: string) => { + const iconMap: Record = { + '/icons/building.svg': Building, + '/icons/home.svg': Home, + '/icons/hotel.svg': Building, + '/icons/coffee.svg': Coffee, + '/icons/wifi.svg': Wifi, + '/icons/settings.svg': Settings, + '/icons/user-check.svg': UserCheck, + '/icons/heart.svg': Heart, + '/icons/trending-up.svg': TrendingUp, + '/icons/users.svg': Users, + '/icons/target.svg': Target, + '/icons/star.svg': Star, + '/icons/compass.svg': Compass, + '/icons/book-open.svg': BookOpen, + '/icons/message-circle.svg': MessageCircle, + '/icons/clock.svg': Clock, + }; -const facilityFeatures = [ - { - phase: "Premium Accommodations", - duration: "World-Class Comfort", - activities: ["Luxury single and double rooms", "Executive suites", "24/7 concierge service", "High-speed internet throughout"], - deliverables: ["Comfortable stay experience", "Professional environment", "Seamless connectivity", "Executive-level service"] - }, - { - phase: "Learning & Meeting Spaces", - duration: "State-of-the-Art Facilities", - activities: ["Modern conference rooms", "Interactive learning spaces", "Breakout areas", "Outdoor meeting spaces"], - deliverables: ["Flexible learning environments", "Technology-enabled spaces", "Collaborative areas", "Natural settings"] - }, - { - phase: "Dining & Recreation", - duration: "Complete Experience", - activities: ["Gourmet dining options", "Healthy meal programs", "Recreation facilities", "Wellness amenities"], - deliverables: ["Nutritious meal programs", "Networking opportunities", "Physical wellness", "Stress relief activities"] - } -]; - -const expectedOutcomes = [ - { - metric: "96%", - description: "Client satisfaction with facility quality and service", - icon: Heart, - category: "Satisfaction" - }, - { - metric: "87%", - description: "Improvement in program engagement in residential setting", - icon: TrendingUp, - category: "Engagement" - }, - { - metric: "92%", - description: "Would recommend Kautilya Facility to other organizations", - icon: Star, - category: "Recommendation" - }, - { - metric: "78%", - description: "Return rate for repeat bookings and programs", - icon: Building, - category: "Loyalty" - } -]; + const IconComponent = iconMap[iconUrl] || Building; + return IconComponent; +}; export function KautilyaFacility() { const [expandedUseCase, setExpandedUseCase] = useState(null); const [expandedFeature, setExpandedFeature] = useState(0); + // API call with service_type = 'kautilya_facility' + const { data: apiResponse, isLoading, error } = useGetServiceListQuery({ + service_type: 'kautilya_facility' + }); + + const apiData = apiResponse?.data as ServicePageData | undefined; + useEffect(() => { window.scrollTo(0, 0); }, []); + if (isLoading) { + return ( +
+ +
+ ); + } + + if (error || !apiData) { + return ( +
+
+

Error loading content. Please try again later.

+ +
+
+ ); + } + + // Transform data for UI (using API data with fallbacks to static data) + const targetAudience = apiData.audience_section?.audience_cards.map(card => ({ + title: card.title, + description: card.description, + icon: getIconComponent(card.icon_url), + challenges: card.challenges || [] + })) || []; + + const useCases = apiData.use_case_section?.use_case_cards.map(card => ({ + title: card.title, + description: card.description, + icon: getIconComponent(card.icon_url), + scenario: card.highlight_text + })) || []; + + const facilityFeatures = apiData.program_section?.program_phases.map(phase => ({ + phase: phase.phase.title, + duration: phase.phase.duration, + activities: phase.activities.map(activity => activity.text), + deliverables: phase.outcomes.map(outcome => outcome.text) + })) || []; + + const expectedOutcomes = apiData.impact_section?.impact_benefits.map(benefit => ({ + category: benefit.title, + description: benefit.description, + icon: getIconComponent(benefit.icon_url) + })) || []; + + const testimonials = apiData.testimonial_section?.map(testimonial => { + const designationParts = testimonial.designation.split(','); + const role = designationParts[0]?.trim() || ''; + const company = designationParts[1]?.trim() || ''; + + return { + id: parseInt(testimonial.id) || 0, + name: testimonial.name, + role: role, + company: company, + avatar: `https://ui-avatars.com/api/?name=${encodeURIComponent(testimonial.name)}&background=04045B&color=fff&size=128`, + quote: testimonial.content, + rating: 5, + isVideo: !!testimonial.video_url, + videoThumbnail: testimonial.video_url ? `/images/testimonials/thumbnails/${testimonial.id}.jpg` : undefined, + videoUrl: testimonial.video_url || undefined + }; + }) || []; + return (
{/* Hero Section */} @@ -156,7 +308,7 @@ export function KautilyaFacility() {
@@ -179,19 +331,19 @@ export function KautilyaFacility() {

- Kautilya Facility + {apiData.hero_section.headline}

- Experience world-class residential learning at our premium campus with 96% client satisfaction and exceptional facilities designed for leadership excellence. + {apiData.hero_section.subtext}

navigateTo('/contact?topic=kautilya-facility')} - ariaLabel="Book a consultation for Kautilya Facility" + text={apiData.hero_section.cta_text} + onClick={() => navigateTo(apiData.hero_section.cta_destination)} + ariaLabel={apiData.hero_section.cta_text} className="primary-cta-button-blue cta-text-white" />
@@ -206,70 +358,41 @@ export function KautilyaFacility() {
-

Premium Learning Campus & Residential Programs

+

{apiData.overview.title}

- Kautilya Facility is a world-class residential learning campus designed specifically for executive education and leadership development programs. Our premium facility combines luxury accommodations, state-of-the-art learning spaces, and comprehensive amenities to create an immersive environment that maximizes learning outcomes and program engagement. + {apiData.overview.description}

- The Business Problem It Solves: Many organizations struggle to find appropriate venues that combine professional learning environments with quality accommodations for residential programs. Standard hotels lack the specialized learning infrastructure, while conference centers often compromise on accommodation quality. Our facility eliminates these compromises by providing an integrated solution designed specifically for executive learning. + The Business Problem It Solves: {apiData.overview.highlight_text}

-
-
-
- + {apiData.overview.overview_cards.map((card, index) => { + const IconComponent = getIconComponent(card.icon_url); + return ( +
+
+
+ +
+

+ {card.title} +

+

+ {card.description} +

+
-

- Premium Campus -

-

- World-class residential learning campus with luxury amenities and sophisticated infrastructure -

-
-
- -
-
-
- -
-

- Learning-Focused Design -

-

- Specialized spaces designed for optimal learning and development with cutting-edge technology -

-
-
- -
-
-
- -
-

- 96% Satisfaction Rate -

-

- Exceptional client satisfaction with facility quality, service excellence, and learning outcomes -

-
-
+ ); + })}
@@ -281,9 +404,9 @@ export function KautilyaFacility() {
-

Target Audience

+

{apiData.audience_section.title}

- Designed for organizations and teams seeking premium residential learning and strategic planning experiences. + {apiData.audience_section.description}

@@ -326,9 +449,9 @@ export function KautilyaFacility() {
-

When Organizations Need Premium Learning Facilities

+

{apiData.use_case_section.title}

- Ideal for organizations seeking world-class residential learning experiences and strategic planning sessions. + {apiData.use_case_section.description}

@@ -338,7 +461,6 @@ export function KautilyaFacility() { key={index} className="bg-white rounded-xl border border-gray-200 p-6 hover:border-[#04045B] hover:shadow-lg transition-all duration-300" > - {/* Icon and Title */}
- {/* Ideal For Indicator */}
@@ -377,9 +498,9 @@ export function KautilyaFacility() {
-

Integrated Learning Campus Experience

+

{apiData.approach_section.title}

- Our comprehensive approach combines premium accommodations, state-of-the-art learning facilities, and exceptional service delivery. + {apiData.approach_section.description}

@@ -388,85 +509,41 @@ export function KautilyaFacility() { {/* Desktop: Horizontal Flowchart */}
- {/* Row 1: Facilities, Services, Technology */} + {/* Row 1: First 3 approach cards from API */}
- {/* Facilities */} -
-
- -
-

Premium Facilities

-

- World-class accommodations and learning environments -

-
-
- Luxury Accommodations + {apiData.approach_section.approach_cards.slice(0, 3).map((card, idx) => { + const IconComponent = getIconComponent(card.icon_url); + return ( +
+
+ +
+

{card.title}

+

{card.description}

+
+ {card.bullets.slice(0, 3).map((bullet, bulletIdx) => ( +
+ {bullet} +
+ ))} +
-
- Learning Spaces -
-
- Wellness Facilities -
-
-
+ ); + })} - {/* Arrow 1→2 */} -
-
- -
- - {/* Services */} -
-
- + {/* Arrows between first 3 cards */} + {apiData.approach_section.approach_cards.length >= 2 && ( +
+
+
-

Service Excellence

-

- Exceptional hospitality and dining experiences -

-
-
- Gourmet Catering -
-
- 24/7 Concierge -
-
- Event Management -
+ )} + {apiData.approach_section.approach_cards.length >= 3 && ( +
+
+
-
- - {/* Arrow 2→3 */} -
-
- -
- - {/* Technology */} -
-
- -
-

Technology Infrastructure

-

- Advanced technology for seamless learning delivery -

-
-
- High-Speed Internet -
-
- AV Equipment -
-
- Tech Support -
-
-
+ )}
{/* Vertical Connector - Center Flow Down */} @@ -477,58 +554,39 @@ export function KautilyaFacility() {
- {/* Row 2: Customization, Support */} -
- {/* Customization */} -
-
- -
-

Flexible Customization

-

- Adaptable spaces configured to your program needs -

-
-
- Room Configurations -
-
- Custom Setups -
-
- Branding Options -
-
-
+ {/* Row 2: Next 2 approach cards (if available) */} + {apiData.approach_section.approach_cards.length >= 4 && ( +
+ {apiData.approach_section.approach_cards.slice(3, 5).map((card, idx) => { + const IconComponent = getIconComponent(card.icon_url); + const isFirstOfPair = idx === 0; + return ( +
+
+ +
+

{card.title}

+

{card.description}

+
+ {card.bullets.slice(0, 3).map((bullet, bulletIdx) => ( +
+ {bullet} +
+ ))} +
+
+ ); + })} - {/* Arrow 4→5 */} -
-
- + {/* Arrow between the two cards */} + {apiData.approach_section.approach_cards.length >= 5 && ( +
+
+ +
+ )}
- - {/* Dedicated Support */} -
-
- -
-

Dedicated Support

-

- Expert team ensuring flawless program execution -

-
-
- Event Coordinators -
-
- Facility Staff -
-
- Technical Team -
-
-
-
+ )} {/* Final Vertical Connector - Center Flow Down to Outcome */}
@@ -538,19 +596,35 @@ export function KautilyaFacility() {
- {/* Row 3: Expected Outcome - Centered */} + {/* Row 3: Expected Outcome - Use API outcomes data */}
- -

Expected Outcome

+ {apiData.approach_section.outcomes && apiData.approach_section.outcomes[0] && (() => { + const OutcomeIcon = getIconComponent(apiData.approach_section.outcomes[0].icon_url); + return ; + })() || } +

+ {apiData.approach_section.outcomes?.[0]?.title || "Expected Outcome"} +

- An immersive learning environment that enhances focus, engagement, and program effectiveness for transformational results. + {apiData.approach_section.outcomes?.[0]?.description || "Transformational executive leaders with strategic capability, executive presence, and proven business impact."}

-
- - Exceptional Learning Experience +
+ {apiData.approach_section.outcomes?.[0]?.bullets?.slice(0, 2).map((bullet, idx) => ( +
+ + {bullet} +
+ )) || ( + <> +
+ + Exceptional Learning Experience +
+ + )}
@@ -559,198 +633,95 @@ export function KautilyaFacility() { {/* Tablet & Mobile: Vertical Flowchart */}
- {/* Facilities */} -
-
-
- + {/* Map all approach cards vertically */} + {apiData.approach_section.approach_cards.map((card, idx) => { + const IconComponent = getIconComponent(card.icon_url); + const isEven = idx % 2 === 0; + return ( +
+
+
+ +
+

{card.title}

+

{card.description}

+
+ {card.bullets.map((bullet, bulletIdx) => ( +
+ {bullet} +
+ ))} +
+
+ {/* Connector Arrow */} + {idx < apiData.approach_section.approach_cards.length - 1 && ( +
+ +
+ )}
-

Premium Facilities

-

- World-class accommodations and learning environments -

-
-
- Luxury Accommodations -
-
- Learning Spaces -
-
- Wellness Facilities -
-
-
- {/* Connector Arrow */} -
- -
-
+ ); + })} - {/* Services */} -
-
-
- -
-

Service Excellence

-

- Exceptional hospitality and dining experiences -

-
-
- Gourmet Catering -
-
- 24/7 Concierge -
-
- Event Management -
-
-
- {/* Connector Arrow */} -
- -
-
- - {/* Technology */} -
-
-
- -
-

Technology Infrastructure

-

- Advanced technology for seamless learning delivery -

-
-
- High-Speed Internet -
-
- AV Equipment -
-
- Tech Support -
-
-
- {/* Connector Arrow */} -
- -
-
- - {/* Customization */} -
-
-
- -
-

Flexible Customization

-

- Adaptable spaces configured to your program needs -

-
-
- Room Configurations -
-
- Custom Setups -
-
- Branding Options -
-
-
- {/* Connector Arrow */} -
- -
-
- - {/* Dedicated Support */} -
-
-
- -
-

Dedicated Support

-

- Expert team ensuring flawless program execution -

-
-
- Event Coordinators -
-
- Facility Staff -
-
- Technical Team -
-
-
- {/* Connector Arrow */} -
- -
-
- - {/* Expected Outcome */} + {/* Expected Outcome - Use API outcomes data */}
- -

Expected Outcome

+ {apiData.approach_section.outcomes && apiData.approach_section.outcomes[0] && (() => { + const OutcomeIcon = getIconComponent(apiData.approach_section.outcomes[0].icon_url); + return ; + })() || } +

+ {apiData.approach_section.outcomes?.[0]?.title || "Expected Outcome"} +

- An immersive learning environment that enhances focus, engagement, and program effectiveness for transformational results. + {apiData.approach_section.outcomes?.[0]?.description || "Transformational executive leaders with strategic capability, executive presence, and proven business impact."}

-
- - Exceptional Learning Experience +
+ {apiData.approach_section.outcomes?.[0]?.bullets?.slice(0, 2).map((bullet, idx) => ( +
+ + {bullet} +
+ )) || ( + <> +
+ + Exceptional Learning Experience +
+ + )}
- {/* Framework Effectiveness */} - {/*
-
-

Facility Excellence Metrics

-

- Our integrated campus approach delivers superior learning outcomes through exceptional environments. -

-
- -
-
-
- -
-
96%
-

Guest Satisfaction Rating

+ {/* Framework Effectiveness - Stats Section */} + {apiData.stats_section && ( +
+
+

{apiData.stats_section.title}

+

+ {apiData.stats_section.description} +

-
-
- -
-
92%
-

Program Effectiveness Increase

-
- -
-
- -
-
89%
-

Repeat Booking Rate

+
+ {apiData.stats_section.stat_cards.map((stat) => { + const IconComponent = getIconComponent(stat.icon_url); + return ( +
+
+ +
+
{stat.value}
+

{stat.label}

+
+ ); + })}
-
*/} + )}
@@ -762,9 +733,9 @@ export function KautilyaFacility() {
-

Complete Campus Experience

+

{apiData.program_section.title}

- A comprehensive facility experience designed to maximize learning outcomes and participant satisfaction. + {apiData.program_section.description}

@@ -845,119 +816,104 @@ export function KautilyaFacility() {
-

Measurable Facility Outcomes

+

{apiData.impact_section.title}

- Organizations consistently report high satisfaction and improved program outcomes when using our premium facility. + {apiData.impact_section.description}

- {/* Outcomes Grid */} -
- {expectedOutcomes.map((outcome, index) => ( - - -
- -
- {/*
- {outcome.metric} -
*/} -

{outcome.category}

- -

{outcome.description}

- {/*

{outcome.category}

*/} -
-
- ))} +
+ {apiData.impact_section.impact_stats.map((stat) => { + const IconComponent = getIconComponent(stat.icon_url); + return ( + + +
+ +
+
+ {stat.value} +
+

{stat.description}

+

{stat.label}

+
+
+ ); + })}
-
+

Additional Facility Benefits

-
- -

Premium Environment

-

World-class facilities that enhance learning and networking

-
-
- -

Exceptional Service

-

Dedicated support staff and personalized service excellence

-
-
- -

Strategic Location

-

Convenient location with peaceful, focused learning environment

-
+ {apiData.impact_section.impact_benefits.map((benefit) => { + const IconComponent = getIconComponent(benefit.icon_url); + return ( +
+
+ +
+

{benefit.title}

+

{benefit.description}

+
+ ); + })}
- {/* 7. Client Examples / Testimonials - Hero Section Design */} + {/* 7. Client Examples / Testimonials */} - {/* 8. CTA Section - Hero Section Design */} -
- {/* Background Image */} -
- - - {/* Subtle dark overlay for overall image */} -
- - {/* Gradient overlay for better text readability */} -
-
- - {/* Content Container */} -
- {/* CTA Content Block */} -
- {/* Branded Tag */} - - - {/* Main Headline */} -

- Ready to experience Kautilya Facility? - - {" "}Get in touch{" "} - - for world-class learning spaces. -

- - {/* CTA Button */} - navigateTo('/contact?topic=kautilya-facility')} - ariaLabel="Schedule a Kautilya Facility tour" + {/* 8. CTA Section */} + {apiData.cta_section && ( +
+
+ - - {/* Supporting Text */} -

- Connect with our facility experts to discuss hosting your next leadership program or strategic retreat at our world-class residential learning campus. -

+
+
-
-
+ +
+
+ +

+ {apiData.cta_section.text} + + {" "}Get in touch{" "} + + to schedule your facility tour. +

+ navigateTo(apiData.cta_section.cta_destination)} + ariaLabel={apiData.cta_section.cta_text} + /> + {apiData.cta_section.description && ( +

+ {apiData.cta_section.description} +

+ )} +
+
+
+ )}
); } \ No newline at end of file diff --git a/src/components/LearningOnline.tsx b/src/components/LearningOnline.tsx index ca3d425..558cedb 100644 --- a/src/components/LearningOnline.tsx +++ b/src/components/LearningOnline.tsx @@ -1,206 +1,55 @@ -import React, { useState, useRef, useEffect } from 'react'; -import { Button } from './ui/button'; -import { Badge } from './ui/badge'; -import { Tabs, TabsContent, TabsList, TabsTrigger } from './ui/tabs'; -import { Card, CardContent, CardHeader, CardTitle } from './ui/card'; -import { Input } from './ui/input'; -import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from './ui/select'; import { - Play, - Users, - Clock, - ChevronRight, ChevronLeft, - GraduationCap, - MessageCircle, - Zap, - Video, - Smartphone, - Award, - Building2, - BookOpen, - Star, - Globe, - Target, - TrendingUp, - Lightbulb, - CheckCircle, - ArrowRight, - Calendar, - Search, + ChevronRight, + Clock, + DollarSign, Filter, Grid, List, - X, - DollarSign + Search, + Star, + Users, + X } from 'lucide-react'; import { motion } from 'motion/react'; -import { navigateTo } from './Router'; -import { ImageWithFallback } from './figma/ImageWithFallback'; -import { BrandedTag } from './about/BrandedTag'; -import { PrimaryCTAButton } from './PrimaryCTAButton'; -import { CourseCard } from './CourseCard'; -import { CartPopup, CartItem } from './CartPopup'; +import { useState, useEffect, useMemo, useCallback } from 'react'; import { useCart } from './CartContext'; +import { CartItem, CartPopup } from './CartPopup'; +import { CourseCard } from './CourseCard'; +import { ImageWithFallback } from './figma/ImageWithFallback'; +import { navigateTo } from './Router'; +import { Badge } from './ui/badge'; +import { Button } from './ui/button'; +import { Card } from './ui/card'; +import { Input } from './ui/input'; +import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from './ui/select'; +import { + courseApi, + useGetCoursesQuery, + Course, + GetCoursesParams, + useGetCourseCategoriesQuery, + CourseCategory +} from '../redux/services/courseApi'; +import { useDebounce } from '../redux/hooks/useDebounce'; -// Course Categories -const courseCategories = [ - 'Leadership Fundamentals', - 'Decision Making & Strategy', - 'Perspective & Risk', - 'Communication & Influence', - 'Change & Innovation' -]; +// Helper function to parse rupee price from string (keep as is) +const parsePriceToNumber = (priceStr: string | number): number => { + if (typeof priceStr === 'number') return priceStr; + const numericStr = priceStr.toString().replace(/[^0-9.-]/g, ''); + return parseFloat(numericStr) || 0; +}; -// Featured Courses Data - Updated with Rupee pricing -const featuredCourses = [ - { - id: '1', - title: 'Strategic Leadership Foundations', - thumbnail: 'https://images.unsplash.com/photo-1552664730-d307ca884978?w=400&h=250&fit=crop', - duration: '12 hours', - level: 'Intermediate', - format: 'Self-paced', - rating: 4.8, - participants: '2,400+', - category: 'Leadership Fundamentals', - description: 'Master the core principles of strategic leadership and organizational vision.', - price: '₹24,817', - originalPrice: '₹33,117' - }, - { - id: '2', - title: 'Data-Driven Decision Making', - thumbnail: 'https://images.unsplash.com/photo-1460925895917-afdab827c52f?w=400&h=250&fit=crop', - duration: '8 hours', - level: 'Advanced', - format: 'Cohort-based', - rating: 4.9, - participants: '1,800+', - category: 'Decision Making & Strategy', - description: 'Learn to make strategic decisions using data analytics and business intelligence.', - price: '₹37,267', - originalPrice: '₹45,567' - }, - { - id: '3', - title: 'Risk Assessment & Management', - thumbnail: 'https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=400&h=250&fit=crop', - duration: '10 hours', - level: 'Intermediate', - format: 'Self-paced', - rating: 4.7, - participants: '3,200+', - category: 'Perspective & Risk', - description: 'Develop expertise in identifying, analyzing, and mitigating organizational risks.', - price: '₹28,967', - originalPrice: '₹37,267' - }, - { - id: '4', - title: 'Influential Communication', - thumbnail: 'https://images.unsplash.com/photo-1556761175-b413da4baf72?w=400&h=250&fit=crop', - duration: '6 hours', - level: 'Beginner', - format: 'Self-paced', - rating: 4.8, - participants: '5,100+', - category: 'Communication & Influence', - description: 'Master the art of persuasive communication and stakeholder engagement.', - price: '₹16,517', - originalPrice: '₹20,667' - }, - { - id: '5', - title: 'Leading Innovation & Change', - thumbnail: 'https://images.unsplash.com/photo-1542744173-8e7e53415bb0?w=400&h=250&fit=crop', - duration: '14 hours', - level: 'Advanced', - format: 'Cohort-based', - rating: 4.9, - participants: '1,950+', - category: 'Change & Innovation', - description: 'Drive organizational transformation and foster a culture of innovation.', - price: '₹45,567', - originalPrice: '₹53,867' - }, - { - id: '6', - title: 'Digital Leadership Essentials', - thumbnail: 'https://images.unsplash.com/photo-1551434678-e076c223a692?w=400&h=250&fit=crop', - duration: '9 hours', - level: 'Intermediate', - format: 'Self-paced', - rating: 4.6, - participants: '2,800+', - category: 'Leadership Fundamentals', - description: 'Navigate the digital transformation as a modern leader.', - price: '₹23,157', - originalPrice: '₹28,967' - }, - { - id: '7', - title: 'Crisis Leadership Strategies', - thumbnail: 'https://images.unsplash.com/photo-1584697964358-3e14ca57658b?w=400&h=250&fit=crop', - duration: '7 hours', - level: 'Advanced', - format: 'Cohort-based', - rating: 4.7, - participants: '1,200+', - category: 'Leadership Fundamentals', - description: 'Navigate uncertainty and lead your team through challenging situations with confidence.', - price: '₹33,117', - originalPrice: '₹41,417' - }, - { - id: '8', - title: 'Emotional Intelligence for Leaders', - thumbnail: 'https://images.unsplash.com/photo-1559027615-cd4628902d4a?w=400&h=250&fit=crop', - duration: '5 hours', - level: 'Beginner', - format: 'Self-paced', - rating: 4.9, - participants: '4,300+', - category: 'Communication & Influence', - description: 'Develop emotional intelligence to enhance your leadership effectiveness.', - price: '₹14,857', - originalPrice: '₹19,007' - }, - { - id: 'ldp-foundations', - title: 'Strategic Leadership Development Program: Foundations', - thumbnail: 'https://images.unsplash.com/photo-1588912914078-2fe5224fd8b8?w=400&h=250&fit=crop', - duration: '40 hours', - level: 'Intermediate', - format: 'Self-paced', - rating: 4.8, - participants: '1,247+', - category: 'Leadership Development', - description: 'Master the fundamentals of effective leadership through evidence-based practices and real-world case studies.', - price: '$599', - originalPrice: '$799' - }, - { - id: '9', - title: 'Strategic Risk Analysis', - thumbnail: 'https://images.unsplash.com/photo-1560472355-536de3962603?w=400&h=250&fit=crop', - duration: '11 hours', - level: 'Advanced', - format: 'Self-paced', - rating: 4.8, - participants: '1,500+', - category: 'Perspective & Risk', - description: 'Master advanced risk analysis techniques for strategic decision-making.', - price: '₹39,757', - originalPrice: '₹49,717' - } -]; +// Format price with Rupee symbol (keep as is) +const formatPrice = (price: number): string => { + return `₹${price.toLocaleString('en-IN')}`; +}; export function LearningOnline() { + // UI state const [searchTerm, setSearchTerm] = useState(''); - const [selectedCategory, setSelectedCategory] = useState('All Categories'); - const [selectedLevel, setSelectedLevel] = useState('All Levels'); - const [selectedFormat, setSelectedFormat] = useState('All Formats'); + const [selectedCategoryId, setSelectedCategoryId] = useState(''); + const [selectedCategoryName, setSelectedCategoryName] = useState('All Categories'); const [selectedPriceRange, setSelectedPriceRange] = useState('All Prices'); const [selectedDuration, setSelectedDuration] = useState('All Durations'); const [selectedRating, setSelectedRating] = useState('All Ratings'); @@ -208,99 +57,250 @@ export function LearningOnline() { const [viewMode, setViewMode] = useState<'grid' | 'list'>('grid'); const [currentPage, setCurrentPage] = useState(1); const coursesPerPage = 9; + const prefetchCourseById = courseApi.usePrefetch('getcoursebyid'); - // Cart functionality - using global cart context - const { addToCart } = useCart(); - const [isCartPopupOpen, setIsCartPopupOpen] = useState(false); - const [recentlyAddedItem, setRecentlyAddedItem] = useState(null); + // Debounced search term to avoid too many API calls + const debouncedSearchTerm = useDebounce(searchTerm, 500); - // Get unique values for filters - Updated for Rupees - const categories = ['All Categories', ...courseCategories]; - const levels = ['All Levels', ...Array.from(new Set(featuredCourses.map(course => course.level)))]; - const formats = ['All Formats', ...Array.from(new Set(featuredCourses.map(course => course.format)))]; - const priceRanges = ['All Prices', 'Under ₹20,000', '₹20,000 - ₹35,000', '₹35,000 - ₹50,000', 'Over ₹50,000']; - const durations = ['All Durations', 'Under 6 hours', '6-10 hours', '10-15 hours', 'Over 15 hours']; - const ratings = ['All Ratings', '4.5+ Stars', '4.0+ Stars', '3.5+ Stars']; - - const sortOptions = [ - { value: 'Most Popular', label: 'Most Popular' }, - { value: 'newest', label: 'Newest First' }, - { value: 'title', label: 'Title A-Z' }, - { value: 'price_low', label: 'Price: Low to High' }, - { value: 'price_high', label: 'Price: High to Low' }, - { value: 'rating', label: 'Highest Rated' }, - { value: 'duration', label: 'Duration' } - ]; - - // Helper function to parse rupee price - const parseRupeePrice = (priceStr: string) => { - return parseFloat(priceStr.replace('₹', '').replace(/,/g, '')); - }; - - // Filter and sort courses - const filteredCourses = featuredCourses.filter(course => { - const matchesSearch = course.title.toLowerCase().includes(searchTerm.toLowerCase()) || - course.description.toLowerCase().includes(searchTerm.toLowerCase()) || - course.category.toLowerCase().includes(searchTerm.toLowerCase()); - - const matchesCategory = selectedCategory === 'All Categories' || course.category === selectedCategory; - const matchesLevel = selectedLevel === 'All Levels' || course.level === selectedLevel; - const matchesFormat = selectedFormat === 'All Formats' || course.format === selectedFormat; - - // Price filter - Updated for Rupees - const price = parseRupeePrice(course.price); - const matchesPrice = selectedPriceRange === 'All Prices' || - (selectedPriceRange === 'Under ₹20,000' && price < 20000) || - (selectedPriceRange === '₹20,000 - ₹35,000' && price >= 20000 && price <= 35000) || - (selectedPriceRange === '₹35,000 - ₹50,000' && price >= 35000 && price <= 50000) || - (selectedPriceRange === 'Over ₹50,000' && price > 50000); - - // Duration filter - const durationHours = parseInt(course.duration); - const matchesDuration = selectedDuration === 'All Durations' || - (selectedDuration === 'Under 6 hours' && durationHours < 6) || - (selectedDuration === '6-10 hours' && durationHours >= 6 && durationHours <= 10) || - (selectedDuration === '10-15 hours' && durationHours >= 10 && durationHours <= 15) || - (selectedDuration === 'Over 15 hours' && durationHours > 15); - - // Rating filter - const matchesRating = selectedRating === 'All Ratings' || - (selectedRating === '4.5+ Stars' && course.rating >= 4.5) || - (selectedRating === '4.0+ Stars' && course.rating >= 4.0) || - (selectedRating === '3.5+ Stars' && course.rating >= 3.5); - - return matchesSearch && matchesCategory && matchesLevel && matchesFormat && matchesPrice && matchesDuration && matchesRating; - }).sort((a, b) => { - switch (sortBy) { - case 'Most Popular': - return parseInt(b.participants.replace(/[^\d]/g, '')) - parseInt(a.participants.replace(/[^\d]/g, '')); - case 'newest': - return a.id.localeCompare(b.id); // Assuming newer courses have higher IDs - case 'title': - return a.title.localeCompare(b.title); - case 'price_low': - return parseRupeePrice(a.price) - parseRupeePrice(b.price); - case 'price_high': - return parseRupeePrice(b.price) - parseRupeePrice(a.price); - case 'rating': - return b.rating - a.rating; - case 'duration': - return parseInt(a.duration) - parseInt(b.duration); - default: - return 0; - } + // Fetch course categories + const { data: categoriesData, isLoading: categoriesLoading } = useGetCourseCategoriesQuery({ + limit: 100, + offset: 0 }); - // Paginate results - const totalPages = Math.ceil(filteredCourses.length / coursesPerPage); + const sortOptions = [ + { value: 'most_popular', label: 'Most Popular' }, + { value: 'newest', label: 'Newest First' }, + { value: 'title_asc', label: 'Title A-Z' }, + { value: 'price_asc', label: 'Price: Low to High' }, + { value: 'price_desc', label: 'Price: High to Low' }, + { value: 'rating_desc', label: 'Highest Rated' }, + { value: 'duration_asc', label: 'Duration' } + ]; + + const priceRanges = [ + 'All Prices', + 'Under ₹20,000', + '₹20,000 - ₹35,000', + '₹35,000 - ₹50,000', + 'Over ₹50,000' + ]; + + const durations = [ + 'All Durations', + 'Under 6 hours', + '6-10 hours', + '10-15 hours', + 'Over 15 hours' + ]; + + const ratings = [ + 'All Ratings', + '4.5+ Stars', + '4.0+ Stars', + '3.5+ Stars' + ]; + + // Build categories list + const categories = useMemo(() => { + const cats = [{ id: '', name: 'All Categories' }]; + if (categoriesData?.data?.items) { + categoriesData.data.items.forEach((cat: CourseCategory) => { + cats.push({ id: cat.id, name: cat.category_name }); + }); + } + return cats; + }, [categoriesData]); + + // Helper function to convert UI price range to API format + const getPriceRangeForApi = useCallback((priceRange: string): string | undefined => { + switch (priceRange) { + case 'Under ₹20,000': + return '0-20000'; + case '₹20,000 - ₹35,000': + return '20000-35000'; + case '₹35,000 - ₹50,000': + return '35000-50000'; + case 'Over ₹50,000': + return '50000-999999'; + default: + return undefined; + } + }, []); + + // Helper function to convert UI duration to API format + const getDurationForApi = useCallback((duration: string): string | undefined => { + switch (duration) { + case 'Under 6 hours': + return '0-6'; + case '6-10 hours': + return '6-10'; + case '10-15 hours': + return '10-15'; + case 'Over 15 hours': + return '15-999'; + default: + return undefined; + } + }, []); + + // Helper function to convert UI rating to API format + const getRatingForApi = useCallback((rating: string): number | undefined => { + switch (rating) { + case '4.5+ Stars': + return 4.5; + case '4.0+ Stars': + return 4.0; + case '3.5+ Stars': + return 3.5; + default: + return undefined; + } + }, []); + + // Helper function to convert sort option to API format + const getSortByForApi = useCallback((sort: string): string | undefined => { + switch (sort) { + case 'Most Popular': + return 'popular'; + case 'newest': + return 'newest'; + case 'title': + return 'title_asc'; + case 'price_low': + return 'price_asc'; + case 'price_high': + return 'price_desc'; + case 'rating': + return 'rating_desc'; + case 'duration': + return 'duration_asc'; + default: + return undefined; + } + }, []); + + // Build API filters based on current UI state + const apiFilters: GetCoursesParams = useMemo(() => { + const filters: GetCoursesParams = { + limit: 100, + offset: 0, + status: 'publish' + }; + + // Category filter + if (selectedCategoryId) { + filters.course_category = [selectedCategoryId]; + } + + // Search query + if (debouncedSearchTerm) { + filters.search_query = debouncedSearchTerm; + } + + // Price range + const apiPriceRange = getPriceRangeForApi(selectedPriceRange); + if (apiPriceRange) { + filters.price_range = apiPriceRange; + } + + // Duration range + const apiDurationRange = getDurationForApi(selectedDuration); + if (apiDurationRange) { + filters.duration_range = apiDurationRange; + } + + // Rating + const apiRating = getRatingForApi(selectedRating); + if (apiRating !== undefined) { + filters.min_rating = apiRating; + } + + // Sort by + const apiSortBy = getSortByForApi(sortBy); + if (apiSortBy) { + filters.sort_by = apiSortBy; + } + + return filters; + }, [ + selectedCategoryId, + debouncedSearchTerm, + selectedPriceRange, + selectedDuration, + selectedRating, + sortBy, + getPriceRangeForApi, + getDurationForApi, + getRatingForApi, + getSortByForApi + ]); + + // Fetch courses with API filters + const { + data: coursesData, + isLoading: coursesLoading, + isError, + isFetching // To show loading indicator while fetching + } = useGetCoursesQuery(apiFilters); + + // Reset to page 1 when filters change + useEffect(() => { + setCurrentPage(1); + }, [ + selectedCategoryId, + debouncedSearchTerm, + selectedPriceRange, + selectedDuration, + selectedRating, + sortBy + ]); + + // Transform API response to course format + const courses = useMemo(() => { + if (!coursesData?.data?.items) return []; + + return coursesData.data.items.map((course: Course) => ({ + id: course.id, + title: course.course_name, + thumbnail: course.thumbnail_img || 'https://images.unsplash.com/photo-1552664730-d307ca884978?w=400&h=250&fit=crop', + duration: `${course.total_duration || 0} hours`, + level: 'Intermediate', + format: course.retail_type === 'public' ? 'Cohort-based' : 'Self-paced', + rating: course.avg_rating || 4.5, + reviews: `${course.total_reviews || 0} review${(course.total_reviews || 0) === 1 ? '' : 's'}`, + category: course.course_category_name || 'General', + categoryId: course.course_category_xid || '', + description: course.course_desc || `Master ${course.course_name} with our comprehensive program.`, + price: formatPrice(course.best_value || 0), + originalPrice: formatPrice(course.price || 0), + course_status: course.course_status + })); + }, [coursesData]); + + // Get total courses count from API response + const totalCoursesCount = coursesData?.data?.pagination_info?.total_count || 0; + + // Paginate the courses (since API returns all courses based on filters, we paginate client-side) + const totalPages = Math.ceil(totalCoursesCount / coursesPerPage); const startIndex = (currentPage - 1) * coursesPerPage; - const currentCourses = filteredCourses.slice(startIndex, startIndex + coursesPerPage); + const currentCourses = courses.slice(startIndex, startIndex + coursesPerPage); + + // Handle category change + const handleCategoryChange = (value: string) => { + const selectedCat = categories.find(cat => cat.name === value); + if (selectedCat) { + setSelectedCategoryName(selectedCat.name); + setSelectedCategoryId(selectedCat.id); + } else { + setSelectedCategoryName('All Categories'); + setSelectedCategoryId(''); + } + }; const clearAllFilters = () => { setSearchTerm(''); - setSelectedCategory('All Categories'); - setSelectedLevel('All Levels'); - setSelectedFormat('All Formats'); + handleCategoryChange('All Categories'); setSelectedPriceRange('All Prices'); setSelectedDuration('All Durations'); setSelectedRating('All Ratings'); @@ -308,14 +308,16 @@ export function LearningOnline() { }; const hasActiveFilters = searchTerm || - selectedCategory !== 'All Categories' || - selectedLevel !== 'All Levels' || - selectedFormat !== 'All Formats' || + selectedCategoryName !== 'All Categories' || selectedPriceRange !== 'All Prices' || selectedDuration !== 'All Durations' || selectedRating !== 'All Ratings'; - // Cart functions - using global cart context + // Cart functionality + const { addToCart } = useCart(); + const [isCartPopupOpen, setIsCartPopupOpen] = useState(false); + const [recentlyAddedItem, setRecentlyAddedItem] = useState(null); + const handleAddToCart = (item: CartItem) => { addToCart(item); setRecentlyAddedItem(item); @@ -327,9 +329,39 @@ export function LearningOnline() { setRecentlyAddedItem(null); }; + const handleCourseClick = useCallback((courseId: string) => { + prefetchCourseById(courseId, { force: true }); + navigateTo(`/course/${courseId}`); + }, [prefetchCourseById]); + + // Show loading state + if (coursesLoading || categoriesLoading) { + return ( +
+
+
+

Loading courses...

+
+
+ ); + } + + // Show error state + if (isError) { + return ( +
+
+

Error Loading Courses

+

Failed to load courses. Please try again later.

+ +
+
+ ); + } + return (
- {/* Hero Banner – Digital Learning - Blog Style */} + {/* Hero Banner (keep as is) */}
- {/* Eyebrow Text */}
DIGITAL LEARNING PLATFORM
- - {/* Main Header */}

Discover Your Leadership
Potential Online

- - {/* Sub Text */}

Our Leadership Courses are structured packages which are targeted towards building your leadership abilities. Each course is a wholesome package which not only helps you gain awareness about your leadership style but also gives insights to build your leadership abilities. Every course contains curated content targeted towards a specific leadership ability. Each course consists of our proprietary profiling instruments – Leadership Profilers, conceptual videos and experiences of leaders – Leadership Webcasts, as well as additional content to supplement learning. @@ -371,11 +398,10 @@ export function LearningOnline() {

- {/* Search and Controls Section */} + {/* Search and Controls Section (keep as is) */}
- {/* Search Bar */}
- {/* View Toggle and Sort */}
- - {/* Level Filter */} -
- - -
- - {/* Format Filter */} -
- - setBrochureFormData({...brochureFormData, company: e.target.value})} + onChange={(e) => setBrochureFormData({ ...brochureFormData, company: e.target.value })} />
@@ -1526,10 +2045,10 @@ export function ProgrammeDetail({ slug }: ProgrammeDetailProps) { setBrochureFormData({...brochureFormData, designation: e.target.value})} + onChange={(e) => setBrochureFormData({ ...brochureFormData, designation: e.target.value })} />
- +
diff --git a/src/components/WebinarDetail.tsx b/src/components/WebinarDetail.tsx index 197cbbf..ff176b3 100644 --- a/src/components/WebinarDetail.tsx +++ b/src/components/WebinarDetail.tsx @@ -44,7 +44,7 @@ import { navigateTo } from './Router'; import { ImageWithFallback } from './figma/ImageWithFallback'; import { BrandedTag } from './about/BrandedTag'; import { PrimaryCTAButton } from './PrimaryCTAButton'; -import { toast } from 'sonner@2.0.3'; +import { toast } from 'sonner'; import { getWebinarBySlug, sharedWebinarsData, type WebinarData } from '../data/webinarsData'; interface WebinarDetailProps { diff --git a/src/components/Webinars.tsx b/src/components/Webinars.tsx index e30eeed..e723506 100644 --- a/src/components/Webinars.tsx +++ b/src/components/Webinars.tsx @@ -1,151 +1,100 @@ -import React, { useState, useRef, useEffect } from 'react'; -import { Button } from './ui/button'; -import { Card, CardContent, CardDescription, CardHeader, CardTitle } from './ui/card'; -import { Badge } from './ui/badge'; -import { Input } from './ui/input'; -import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from './ui/select'; -import { Slider } from './ui/slider'; -import { ImageWithFallback } from './figma/ImageWithFallback'; -import { PrimaryCTAButton } from './PrimaryCTAButton'; -import { navigateTo } from './Router'; -import { sharedWebinarsData, type WebinarData } from '../data/webinarsData'; -import { WebcastCTABanner } from './WebcastCTABanner'; import { - Search, - Calendar, - Clock, - Users, - Play, ArrowRight, + ChevronLeft, + ChevronRight, + Clock, + Eye, Filter, Grid, List, - SortAsc, - Eye, + Play, + Search, Star, - ChevronLeft, - ChevronRight, + Users, X } from 'lucide-react'; +import { useEffect, useRef, useState } from 'react'; +import { useWebinarListQuery, type WebinarItem } from '../redux/services/webinarApi'; +import { ImageWithFallback } from './figma/ImageWithFallback'; +import { FullScreenLoader } from './FullScreenLoader'; +import { navigateTo } from './Router'; +import { Badge } from './ui/badge'; +import { Button } from './ui/button'; +import { Card, CardContent } from './ui/card'; +import { Input } from './ui/input'; +import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from './ui/select'; +import { Slider } from './ui/slider'; +import { WebcastCTABanner } from './WebcastCTABanner'; + +// Status options with proper mapping to API values +const statusOptions = [ + { value: 'scheduled', label: '📅 Scheduled', color: 'bg-blue-100 text-blue-800 border-blue-200' }, + { value: 'live', label: '🔴 Live', color: 'bg-red-100 text-red-800 border-red-200' }, + { value: 'ended', label: '✅ Ended', color: 'bg-gray-100 text-gray-800 border-gray-200' }, + { value: 'cancelled', label: '❌ Cancelled', color: 'bg-red-50 text-red-600 border-red-200' } +]; + +const sortOptions = [ + { value: 'most_popular', label: 'Most Popular' }, + { value: 'newest', label: 'Newest First' }, + { value: 'oldest', label: 'Oldest First' }, + { value: 'title', label: 'Title A-Z' }, + { value: 'duration', label: 'Duration' } +]; + +// Static tags for all webinars +const staticTags = ['Leadership', 'Executive Development', 'Strategy', 'Innovation', 'Change Management', 'Business Growth', 'Team Building', 'Digital Transformation']; export function Webinars() { const [searchTerm, setSearchTerm] = useState(''); const [selectedCategory, setSelectedCategory] = useState('All Categories'); - const [selectedFormat, setSelectedFormat] = useState('All Formats'); - const [selectedLevel, setSelectedLevel] = useState('All Levels'); - - // Updated state for multi-select status pills const [selectedStatuses, setSelectedStatuses] = useState([]); - - // Updated state for duration slider (min, max in minutes) const [durationRange, setDurationRange] = useState([0, 120]); - - // Attendee range slider state const [attendeeRange, setAttendeeRange] = useState([0, 5000]); - - const [sortBy, setSortBy] = useState('Most Popular'); + const [sortBy, setSortBy] = useState('most_popular'); const [viewType, setViewType] = useState<'grid' | 'list'>('grid'); const [currentPage, setCurrentPage] = useState(1); const webinarsPerPage = 6; const containerRef = useRef(null); - // Use shared webinars data instead of local mock data - const webinars = sharedWebinarsData; - - // Get unique values for filters from shared data - const categories = ['All Categories', ...Array.from(new Set(webinars.map(webinar => webinar.category)))]; - const formats = ['All Formats', ...Array.from(new Set(webinars.map(webinar => webinar.format)))]; - const levels = ['All Levels', ...Array.from(new Set(webinars.map(webinar => webinar.level)))]; - - // Status options for pills - updated to match shared data structure - const statusOptions = [ - { value: 'upcoming', label: '📅 Upcoming', color: 'bg-blue-100 text-blue-800 border-blue-200' }, - { value: 'live', label: '🔴 Live', color: 'bg-red-100 text-red-800 border-red-200' }, - { value: 'recorded', label: '▶️ Recorded', color: 'bg-green-100 text-green-800 border-green-200' }, - { value: 'featured', label: '⭐ Featured', color: 'bg-yellow-100 text-yellow-800 border-yellow-200' } - ]; - - const sortOptions = [ - { value: 'Most Popular', label: 'Most Popular' }, - { value: 'newest', label: 'Newest First' }, - { value: 'oldest', label: 'Oldest First' }, - { value: 'title', label: 'Title A-Z' }, - { value: 'duration', label: 'Duration' } - ]; - - // Helper function to convert attendees string to number - const parseAttendees = (attendeesStr: string): number => { - const numStr = attendeesStr.replace(/[^\d]/g, ''); - return parseInt(numStr) || 0; - }; - - // Helper function to convert duration string to minutes - const parseDuration = (durationStr: string): number => { - const numStr = durationStr.replace(/[^\d]/g, ''); - return parseInt(numStr) || 0; - }; - - // Filter and sort webinars - const filteredWebinars = webinars.filter(webinar => { - const matchesSearch = webinar.title.toLowerCase().includes(searchTerm.toLowerCase()) || - webinar.description.toLowerCase().includes(searchTerm.toLowerCase()) || - webinar.presenter.toLowerCase().includes(searchTerm.toLowerCase()) || - webinar.tags.some(tag => tag.toLowerCase().includes(searchTerm.toLowerCase())); - const matchesCategory = selectedCategory === 'All Categories' || webinar.category === selectedCategory; - const matchesFormat = selectedFormat === 'All Formats' || webinar.format === selectedFormat; - const matchesLevel = selectedLevel === 'All Levels' || webinar.level === selectedLevel; - - const matchesStatus = selectedStatuses.length === 0 || - selectedStatuses.some(status => { - if (status === 'featured') return webinar.featured; - return webinar.status === status; - }); - - const durationMinutes = parseDuration(webinar.duration); - const matchesDuration = durationMinutes >= durationRange[0] && durationMinutes <= durationRange[1]; - - const attendeeCount = parseAttendees(webinar.attendees); - const matchesAttendees = attendeeCount >= attendeeRange[0] && attendeeCount <= attendeeRange[1]; - - return matchesSearch && matchesCategory && matchesFormat && matchesLevel && matchesStatus && matchesDuration && matchesAttendees; - }).sort((a, b) => { - switch (sortBy) { - case 'Most Popular': - // Add logic for "Most Popular" - you might want to use views, attendees, or featured status - return (b.featured ? 1 : 0) - (a.featured ? 1 : 0) || - parseAttendees(b.attendees) - parseAttendees(a.attendees); - case 'newest': - return new Date(b.date).getTime() - new Date(a.date).getTime(); - case 'oldest': - return new Date(a.date).getTime() - new Date(b.date).getTime(); - case 'title': - return a.title.localeCompare(b.title); - case 'duration': - return parseDuration(b.duration) - parseDuration(a.duration); - default: - return 0; - } + // Fetch webinars from API + const { + data: webinarResponse, + isLoading, + isError, + } = useWebinarListQuery({ + limit: 100, + offset: 0, + search: searchTerm || undefined, + status: selectedStatuses.length > 0 ? selectedStatuses : undefined, + minDuration: durationRange[0] > 0 ? durationRange[0] : undefined, + maxDuration: durationRange[1] < 120 ? durationRange[1] : undefined, + minAttendees: attendeeRange[0] > 0 ? attendeeRange[0] : undefined, + maxAttendees: attendeeRange[1] < 5000 ? attendeeRange[1] : undefined, + sortBy: sortBy as any, }); - // Statistics - const stats = { - total: webinars.length, - upcoming: webinars.filter(w => w.status === 'upcoming').length, - live: webinars.filter(w => w.status === 'live').length, - recorded: webinars.filter(w => w.status === 'recorded').length, - featured: webinars.filter(w => w.featured).length, - categories: new Set(webinars.map(w => w.category)).size + const webinars = webinarResponse?.data?.items || []; + + // Get random tags for each webinar (3 random tags from staticTags) + const getRandomTags = (seed: string) => { + // Use the webinar ID as seed to get consistent tags for each webinar + const hash = seed.split('').reduce((acc, char) => acc + char.charCodeAt(0), 0); + const shuffled = [...staticTags]; + for (let i = shuffled.length - 1; i > 0; i--) { + const j = Math.floor(Math.random() * (i + 1)); + [shuffled[i], shuffled[j]] = [shuffled[j], shuffled[i]]; + } + return shuffled.slice(0, 3); }; - // Paginate results - const totalPages = Math.ceil(filteredWebinars.length / webinarsPerPage); - const currentWebinars = filteredWebinars.slice((currentPage - 1) * webinarsPerPage, currentPage * webinarsPerPage); - - console.log('Filtered webinars:', filteredWebinars.length); -console.log('Total pages:', totalPages); -console.log('Current page:', currentPage); -console.log('Current webinars count:', currentWebinars.length); + // Get unique categories from API data + const categories = [ + 'All Categories', + ...Array.from(new Set(webinars.map(webinar => webinar.session_title?.split(' ')[0] || 'General'))) + ]; + // Helper functions const formatDate = (dateString: string) => { return new Date(dateString).toLocaleDateString('en-US', { year: 'numeric', @@ -154,26 +103,81 @@ console.log('Current webinars count:', currentWebinars.length); }); }; + const formatDuration = (minutes: number) => { + if (minutes >= 60) { + const hours = Math.floor(minutes / 60); + const remainingMinutes = minutes % 60; + return remainingMinutes > 0 ? `${hours}h ${remainingMinutes}m` : `${hours}h`; + } + return `${minutes}min`; + }; + + const getStatusBadge = (status: string) => { + switch (status) { + case 'live': + return LIVE NOW; + case 'scheduled': + return SCHEDULED; + case 'ended': + return ENDED; + case 'cancelled': + return CANCELLED; + default: + return null; + } + }; + + const getActionText = (status: string) => { + switch (status) { + case 'live': + return 'Join Now'; + case 'scheduled': + return 'Register'; + case 'ended': + return 'Watch Recording'; + case 'cancelled': + return 'Cancelled'; + default: + return 'Learn More'; + } + }; + + // Statistics + const stats = { + total: webinars.length, + scheduled: webinars.filter(w => w.webinar_status === 'scheduled').length, + live: webinars.filter(w => w.webinar_status === 'live').length, + ended: webinars.filter(w => w.webinar_status === 'ended').length, + cancelled: webinars.filter(w => w.webinar_status === 'cancelled').length, + categories: categories.length - 1 + }; + + // Filter webinars + const filteredWebinars = webinars.filter(webinar => { + const matchesCategory = selectedCategory === 'All Categories' || + (webinar.session_title && webinar.session_title.toLowerCase().includes(selectedCategory.toLowerCase())); + return matchesCategory; + }); + + // Paginate results + const totalPages = Math.ceil(filteredWebinars.length / webinarsPerPage); + const currentWebinars = filteredWebinars.slice((currentPage - 1) * webinarsPerPage, currentPage * webinarsPerPage); + const clearAllFilters = () => { setSearchTerm(''); setSelectedCategory('All Categories'); - setSelectedFormat('All Formats'); - setSelectedLevel('All Levels'); setSelectedStatuses([]); setDurationRange([0, 120]); setAttendeeRange([0, 5000]); - setSortBy('Most Popular'); + setSortBy('most_popular'); }; const hasActiveFilters = searchTerm || selectedCategory !== 'All Categories' || - selectedFormat !== 'All Formats' || - selectedLevel !== 'All Levels' || selectedStatuses.length > 0 || durationRange[0] !== 0 || durationRange[1] !== 120 || attendeeRange[0] !== 0 || attendeeRange[1] !== 5000; - // Status pill toggle function const toggleStatus = (status: string) => { setSelectedStatuses(prev => prev.includes(status) @@ -182,95 +186,78 @@ console.log('Current webinars count:', currentWebinars.length); ); }; - // Reset to page 1 when filters change useEffect(() => { setCurrentPage(1); - }, [searchTerm, selectedCategory, selectedFormat, selectedLevel, selectedStatuses, durationRange, attendeeRange, sortBy]); + }, [searchTerm, selectedCategory, selectedStatuses, durationRange, attendeeRange, sortBy]); - // Updated WebinarCard component that navigates to consistent route - const WebinarCard = ({ webinar }: { webinar: WebinarData }) => { + const WebinarCard = ({ webinar }: { webinar: WebinarItem }) => { const handleCardClick = () => { - // Navigate to consistent webinar detail route - navigateTo(`/webinar/${webinar.slug}`); - }; - - const getStatusBadge = () => { - switch (webinar.status) { - case 'live': - return LIVE; - case 'upcoming': - return UPCOMING; - case 'recorded': - return RECORDED; - default: - return null; + if (webinar.webinar_status !== 'cancelled') { + navigateTo(`/webinar/${webinar.id}`); } }; - const getActionText = () => { - switch (webinar.status) { - case 'live': - return 'Join Now'; - case 'upcoming': - return 'Register'; - case 'recorded': - return 'Watch Recording'; - default: - return 'Learn More'; - } - }; + const isCancelled = webinar.webinar_status === 'cancelled'; + const webinarTags = getRandomTags(webinar.id); if (viewType === 'list') { return (
{/* Thumbnail */} -
- +
+
{/* Content */}
- {getStatusBadge()} - {webinar.featured && ( - Featured - )} + {getStatusBadge(webinar.webinar_status)}
- {formatDate(webinar.date)} + {formatDate(webinar.session_datetime)}
-

{webinar.title}

-

{webinar.description}

+

{webinar.session_title}

+

+ {webinar.description || 'No description available'} +

+ + {/* Tags */} +
+ {webinarTags.map((tag, idx) => ( + + {tag} + + ))} +
- {webinar.presenter} + {webinar.owner || 'Kautilya Leadership'} - {webinar.duration} + {formatDuration(webinar.duration_minutes)} - {webinar.attendees} + Max {webinar.max_attendee.toLocaleString()}
-
- {getActionText()} - -
+ {!isCancelled && ( +
+ {getActionText(webinar.webinar_status)} + +
+ )}
@@ -279,100 +266,122 @@ console.log('Current webinars count:', currentWebinars.length); ); } + // Grid View return ( {/* Image */} -
- +
+
+ +
{/* Status Badge */}
- {getStatusBadge()} + {getStatusBadge(webinar.webinar_status)}
- {/* Featured Badge */} - {webinar.featured && ( -
- - - Featured - -
- )} - {/* Play Icon Overlay */} -
-
- + {!isCancelled && ( +
+
+ +
-
+ )}
{/* Content */}
- {webinar.category} + {webinar.recurring_webinar ? 'Recurring' : 'One-time'} - {formatDate(webinar.date)} + {formatDate(webinar.session_datetime)}

- {webinar.title} + {webinar.session_title}

- {webinar.description} + {webinar.description || 'No description available'}

+ {/* Tags */} +
+ {webinarTags.slice(0, 2).map((tag, idx) => ( + + {tag} + + ))} +
+
- {webinar.presenter} + {webinar.owner || 'Kautilya Leadership'}
- {webinar.duration} + {formatDuration(webinar.duration_minutes)}
- {webinar.attendees} + Max {webinar.max_attendee.toLocaleString()}
-
-
- {webinar.tags.slice(0, 2).map((tag, index) => ( - - {tag} - - ))} + {!isCancelled && ( +
+
+ {webinar.require_registration && ( + <> + + Registration Required + + )} +
+
+ {getActionText(webinar.webinar_status)} + +
-
- {getActionText()} - -
-
+ )} ); }; + if (isLoading) { + return ( +
+ +
+ ); + } + + if (isError) { + return ( +
+
+

Error loading webinars. Please try again later.

+ +
+
+ ); + } + return (
- {/* Hero Section with Background Image */} + {/* Hero Section */}
- {/* Background Image */}
- {/* Hero Content */}

Leadership Webcasts &
Expert Insights

-

Explore our comprehensive collection of expert insights, research, and practical guidance to elevate your leadership journey and drive organizational excellence. @@ -397,8 +404,7 @@ console.log('Current webinars count:', currentWebinars.length);

- {/* Statistics Strip at Bottom */} -
+
@@ -424,12 +430,11 @@ console.log('Current webinars count:', currentWebinars.length);
- {/* Search Bar */}
setSearchTerm(e.target.value)} className="pl-10 pr-4 py-3 text-body rounded-lg border border-gray-300 focus:border-blue-500 focus:ring-2 focus:ring-blue-200 transition-all duration-200 w-full bg-gray-50" @@ -441,7 +446,6 @@ console.log('Current webinars count:', currentWebinars.length); />
- {/* View Toggle and Sort */}
- {/* Main Content Section with Sidebar */} + {/* Main Content Section */}
- {/* Left Sidebar - Sticky Filters */} + {/* Left Sidebar Filters */}
- {/* Filter Header */}
- +
-

- Filters -

+

Filters

{hasActiveFilters && (
- {/* Filter Content */}
- {/* Category Filter */} -
- - -
- - {/* Format Filter */} -
- - -
- - {/* Level Filter */} -
- - -
- - {/* Status Filter - Multi-select Pills */} + {/* Status Filter */}
- {/* Duration Filter - Slider */} + {/* Duration Filter */}
{durationRange[0]} min {durationRange[1]} min
-
- {durationRange[0] === 0 && durationRange[1] === 120 - ? 'All durations' - : `${durationRange[0]}-${durationRange[1]} minutes` - } -
- {/* Attendee Count Filter - Slider */} + {/* Attendee Filter */}
{attendeeRange[0].toLocaleString()} {attendeeRange[1].toLocaleString()}+
-
- {attendeeRange[0] === 0 && attendeeRange[1] === 5000 - ? 'Any size' - : `${attendeeRange[0].toLocaleString()}-${attendeeRange[1].toLocaleString()}+` - } -
@@ -672,24 +603,22 @@ console.log('Current webinars count:', currentWebinars.length); {/* Right Main Content */}
- {/* Results Header */}
- Showing {currentWebinars.length} of {filteredWebinars.length} webcasts + Showing {currentWebinars.length} of {filteredWebinars.length} webinars
Page {currentPage} of {totalPages}
- {/* Content Area */}
{currentWebinars.length === 0 ? (
-

No webcasts found

+

No webinars found

Try adjusting your filters or search terms

@@ -701,7 +630,6 @@ console.log('Current webinars count:', currentWebinars.length);
) : ( <> - {/* Grid View */} {viewType === 'grid' ? (
{currentWebinars.map((webinar) => ( @@ -709,7 +637,6 @@ console.log('Current webinars count:', currentWebinars.length); ))}
) : ( - /* List View */
{currentWebinars.map((webinar) => ( @@ -723,64 +650,46 @@ console.log('Current webinars count:', currentWebinars.length); -
- {Array.from({ length: totalPages }, (_, i) => { + {Array.from({ length: Math.min(totalPages, 5) }, (_, i) => { const page = i + 1; - // Show limited pages for better UX - if (totalPages > 7) { - const showPage = - page === 1 || - page === totalPages || - (page >= currentPage - 1 && page <= currentPage + 1); - - if (!showPage) { - if (page === currentPage - 2 || page === currentPage + 2) { - return ...; - } - return null; - } - } - return ( ); })} + {totalPages > 5 && ...} + {totalPages > 5 && ( + + )}
-
- {/* Webcast CTA Banner */}
); diff --git a/src/components/services/CultureCompetence.tsx b/src/components/services/CultureCompetence.tsx index 09a75e9..2188be5 100644 --- a/src/components/services/CultureCompetence.tsx +++ b/src/components/services/CultureCompetence.tsx @@ -1,6 +1,5 @@ import React, { useEffect, useState } from 'react'; import { Button } from '../ui/button'; -import { Badge } from '../ui/badge'; import { Card, CardContent } from '../ui/card'; import { ImageWithFallback } from '../figma/ImageWithFallback'; import { navigateTo } from '../Router'; @@ -11,138 +10,287 @@ import { ArrowRight, CheckCircle, Settings, - Calendar, - Download, - Network, Users, Target, Brain, - Eye, TrendingUp, BarChart3, Award, - Lightbulb, - Shield, ChevronDown, ChevronUp, ArrowLeft, Star, - Zap, - Globe, Clock, - BookOpen, MessageCircle, - Building, Heart, Compass, - Briefcase + Building } from 'lucide-react'; import { TestimonialsSection } from '../TestimonialsSection'; +import { useGetServiceListQuery } from '../../redux/services/sercicesApi'; +import { FullScreenLoader } from '../FullScreenLoader'; -const targetAudience = [ - { - title: "Chief Human Resource Officers", - description: "CHROs and senior HR leaders responsible for organizational culture transformation and employee experience", - icon: Users, - challenges: ["Culture misalignment", "Low engagement scores", "Talent retention issues", "Change resistance"] - }, - { - title: "CEOs & Business Leaders", - description: "Senior executives driving organizational transformation and seeking to align culture with business strategy", - icon: Target, - challenges: ["Strategic culture alignment", "Performance culture gaps", "Change management", "Cultural integration"] - }, - { - title: "Organizational Development Teams", - description: "OD professionals and teams responsible for culture initiatives and organizational effectiveness", - icon: Building, - challenges: ["Culture measurement", "Change intervention design", "Competency modeling", "Assessment implementation"] - } -]; +// Types based on API response +interface ServicePageData { + hero_section: { + id: string; + landing_page_type: string; + background_image_url: string; + background_image_alt_text: string; + headline: string; + subtext: string; + cta_text: string; + cta_destination: string; + }; + overview: { + id: string; + title: string; + description: string; + highlight_text: string; + overview_cards: Array<{ + id: string; + title: string; + description: string; + icon_url: string; + accessible_label: string; + }>; + }; + audience_section: { + id: string; + title: string; + description: string; + audience_cards: Array<{ + id: string; + title: string; + description: string; + icon_url: string; + accessible_label: string; + challenges: string[]; + }>; + }; + use_case_section: { + id: string; + title: string; + description: string; + use_case_cards: Array<{ + id: string; + title: string; + description: string; + icon_url: string; + accessible_label: string; + highlight_text: string; + }>; + }; + approach_section: { + id: string; + title: string; + description: string; + approach_cards: Array<{ + id: string; + title: string; + description: string; + icon_url: string; + accessible_label: string; + bullets: string[]; + }>; + outcomes: Array<{ + id: string; + title: string; + description: string; + icon_url: string; + accessible_label: string; + bullets: string[]; + }>; + }; + stats_section: { + id: string; + title: string; + description: string; + stat_cards: Array<{ + id: string; + value: string; + label: string; + icon_url: string; + accessible_label: string; + }>; + }; + program_section: { + id: string; + title: string; + description: string; + program_phases: Array<{ + phase: { + id: string; + phase_number: number; + title: string; + duration: string; + }; + activities: Array<{ + id: string; + phase_id: string; + text: string; + }>; + outcomes: Array<{ + id: string; + phase_id: string; + text: string; + }>; + }>; + }; + impact_section: { + id: string; + title: string; + description: string; + impact_stats: Array<{ + id: string; + value: string; + description: string; + label: string; + icon_url: string; + accessible_label: string; + }>; + impact_benefits: Array<{ + id: string; + title: string; + description: string; + icon_url: string; + accessible_label: string; + }>; + }; + testimonial_section: Array<{ + id: string; + profile_xid: string; + name: string; + designation: string; + content: string; + video_url: string | null; + display_order: number; + }>; + cta_section: { + id: string; + background_image_url: string; + text: string; + cta_text: string; + cta_destination: string; + description: string; + landing_page_type: string; + service_type: string; + }; +} -const useCases = [ - { - title: "Cultural Misalignment", - description: "When organizational culture doesn't support business strategy or values", - icon: Compass, - scenario: "Culture survey scores below 60% or misaligned with stated values" - }, - { - title: "Low Employee Engagement", - description: "When engagement scores indicate cultural issues affecting performance", - icon: Heart, - scenario: "Employee engagement below industry benchmarks or declining trends" - }, - { - title: "Competency Gaps", - description: "When organizational capabilities don't match strategic requirements", - icon: Target, - scenario: "Skills gaps preventing achievement of strategic objectives" - }, - { - title: "Post-Merger Integration", - description: "When merging cultures or integrating acquisitions require cultural alignment", - icon: Building, - scenario: "M&A activity requiring cultural integration and alignment" - } -]; +// Map API icons to Lucide icons +const getIconComponent = (iconUrl: string) => { + const iconMap: Record = { + '/icons/culture.svg': Heart, + '/icons/competency.svg': Target, + '/icons/hr.svg': Users, + '/icons/management.svg': Building, + '/icons/growth.svg': TrendingUp, + '/icons/alignment.svg': Compass, + '/icons/assessment.svg': BarChart3, + '/icons/development.svg': Brain, + '/icons/outcome.svg': Award, + '/icons/target.svg': Target, + '/icons/engagement.svg': Heart, + '/icons/leader.svg': Award, + '/icons/performance.svg': TrendingUp, + '/icons/people.svg': Users, + '/icons/team.svg': Users, + '/icons/coaching.svg': MessageCircle, + '/icons/compass.svg': Compass, + }; -const programTimeline = [ - { - phase: "Phase 1: Assessment & Diagnosis", - duration: "Months 1-2", - activities: ["Culture assessment and analysis", "Competency gap analysis", "Stakeholder interviews", "Current state evaluation"], - deliverables: ["Culture diagnostic report", "Competency assessment", "Gap analysis", "Transformation roadmap"] - }, - { - phase: "Phase 2: Design & Planning", - duration: "Months 3-4", - activities: ["Target culture definition", "Competency framework design", "Intervention strategy", "Change plan development"], - deliverables: ["Culture transformation plan", "Competency model", "Change strategy", "Implementation timeline"] - }, - { - phase: "Phase 3: Implementation & Integration", - duration: "Months 5-12", - activities: ["Culture interventions", "Competency development", "Change management", "Progress monitoring"], - deliverables: ["Culture transformation results", "Enhanced capabilities", "Sustainable change", "Measurement framework"] - } -]; - -const expectedOutcomes = [ - { - metric: "73%", - description: "Average improvement in employee engagement scores", - icon: Heart, - category: "Engagement" - }, - { - metric: "68%", - description: "Increase in culture alignment with business strategy", - icon: Compass, - category: "Alignment" - }, - { - metric: "81%", - description: "Improvement in organizational competency scores", - icon: Target, - category: "Competency" - }, - { - metric: "45%", - description: "Reduction in culture-related turnover", - icon: Users, - category: "Retention" - } -]; + return iconMap[iconUrl] || Target; +}; export function CultureCompetence() { - const [expandedUseCase, setExpandedUseCase] = useState(null); const [expandedPhase, setExpandedPhase] = useState(0); + const { data: apiResponse, isLoading, error } = useGetServiceListQuery({ + service_type: 'culture_and_competence_consulting' + }); + + const apiData = apiResponse?.data as ServicePageData | undefined; + useEffect(() => { window.scrollTo(0, 0); }, []); + // Loading state + if (isLoading) { + return ( +
+ +
+ ); + } + + // Error state + if (error) { + console.error('API Error:', error); + return ( +
+
+

Error loading content. Please try again later.

+ +
+
+ ); + } + + // Check if apiData exists and has required properties + if (!apiData || !apiData.hero_section) { + return ( +
+
+

No data available for this service.

+ +
+
+ ); + } + + // Transform data for UI with safe fallbacks + const targetAudience = apiData.audience_section?.audience_cards?.map(card => ({ + title: card.title || '', + description: card.description || '', + icon: getIconComponent(card.icon_url), + challenges: card.challenges || [] + })) || []; + + const useCases = apiData.use_case_section?.use_case_cards?.map(card => ({ + title: card.title || '', + description: card.description || '', + icon: getIconComponent(card.icon_url), + scenario: card.highlight_text || '' + })) || []; + + const programTimeline = apiData.program_section?.program_phases?.map(phase => ({ + phase: phase.phase?.title || '', + duration: phase.phase?.duration || '', + activities: phase.activities?.map(activity => activity.text) || [], + deliverables: phase.outcomes?.map(outcome => outcome.text) || [] + })) || []; + + const testimonials = apiData.testimonial_section?.map(testimonial => { + const designationParts = testimonial.designation?.split(',') || []; + const role = designationParts[0]?.trim() || ''; + const company = designationParts[1]?.trim() || ''; + + return { + id: parseInt(testimonial.id) || 0, + name: testimonial.name || '', + role: role, + company: company, + avatar: `https://ui-avatars.com/api/?name=${encodeURIComponent(testimonial.name || 'User')}&background=04045B&color=fff&size=128`, + quote: testimonial.content || '', + rating: 5, + isVideo: !!testimonial.video_url, + videoThumbnail: testimonial.video_url ? `/images/testimonials/thumbnails/${testimonial.id}.jpg` : undefined, + videoUrl: testimonial.video_url || undefined + }; + }) || []; + return (
{/* Hero Section */} @@ -151,7 +299,7 @@ export function CultureCompetence() {
@@ -160,7 +308,6 @@ export function CultureCompetence() {
- {/* Back Navigation */}

- Transform organizational culture and build strategic competencies that drive 73% better engagement and business performance. + {apiData.hero_section.subtext || 'Transform organizational culture and build strategic competencies that drive business performance.'}

navigateTo('/contact?topic=culture-competence')} - ariaLabel="Book a consultation for culture and competence consulting" + text={apiData.hero_section.cta_text || 'Book a Consultation'} + onClick={() => navigateTo(apiData.hero_section.cta_destination || '/contact')} + ariaLabel={apiData.hero_section.cta_text || 'Book a Consultation'} className="primary-cta-button-blue cta-text-white" />
@@ -201,70 +348,41 @@ export function CultureCompetence() {
-

Culture & Competence Transformation

+

{apiData.overview?.title || 'Culture & Competence Transformation'}

- Culture & Competence Consulting is a comprehensive approach to transforming organizational culture and building strategic competencies that drive business performance. Our methodology combines culture assessment, competency development, and change management to create high-performing, engaged organizations. + {apiData.overview?.description || 'A comprehensive approach to transforming organizational culture and building strategic competencies that drive business performance.'}

- The Business Problem It Solves: Many organizations struggle with misaligned cultures that hinder performance, low engagement scores, and competency gaps that prevent strategic goal achievement. Our consulting helps organizations build cultures that support their strategy while developing critical capabilities for success. + The Business Problem It Solves: {apiData.overview?.highlight_text || 'Many organizations struggle with misaligned cultures that hinder performance, low engagement scores, and competency gaps that prevent strategic goal achievement.'}

-
-
-
- + {apiData.overview?.overview_cards?.map((card, index) => { + const IconComponent = getIconComponent(card.icon_url); + return ( +
+
+
+ +
+

+ {card.title} +

+

+ {card.description} +

+
-

- Culture Transformation -

-

- Align organizational culture with business strategy and values for sustainable success -

-
-
- -
-
-
- -
-

- Competency Development -

-

- Build strategic capabilities and organizational competencies for competitive advantage -

-
-
- -
-
-
- -
-

- 73% Performance Impact -

-

- Proven results with 73% improvement in engagement and business performance metrics -

-
-
+ ); + })}
@@ -276,9 +394,9 @@ export function CultureCompetence() {
-

Target Audience

+

{apiData.audience_section?.title || 'Target Audience'}

- Designed for senior leaders and HR professionals driving organizational transformation and culture change. + {apiData.audience_section?.description || 'Designed for senior leaders and HR professionals driving organizational transformation and culture change.'}

@@ -321,9 +439,9 @@ export function CultureCompetence() {
-

When Organizations Need Culture Transformation

+

{apiData.use_case_section?.title || 'When Organizations Need Culture Transformation'}

- Ideal for organizations facing cultural misalignment and competency gaps affecting performance. + {apiData.use_case_section?.description || 'Ideal for organizations facing cultural misalignment and competency gaps affecting performance.'}

@@ -333,7 +451,6 @@ export function CultureCompetence() { key={index} className="bg-white rounded-xl border border-gray-200 p-6 hover:border-[#04045B] hover:shadow-lg transition-all duration-300" > - {/* Icon and Title */}
- {/* Trigger Indicator */}
@@ -372,380 +488,245 @@ export function CultureCompetence() {
-

Integrated Culture & Competency Framework

+

+ {apiData?.approach_section?.title || "Our Approach to Leadership Development"} +

- Our proven methodology combines culture assessment, competency modeling, and transformation planning for sustainable results. + {apiData?.approach_section?.description || "A systematic, research-backed methodology that transforms leadership potential into measurable business impact."}

{/* Flowchart Container with Connecting Lines */}
- {/* Desktop: Horizontal Flowchart */} -
-
- {/* Row 1: Frameworks, Pedagogy, Delivery */} -
- {/* Frameworks */} -
-
- -
-

Culture Frameworks

-

- Diagnostic models and competency frameworks for transformation -

-
-
- Culture Assessment -
-
- Competency Models -
-
- Values Alignment -
-
-
+ {/* Only render if approach_cards exist and have items */} + {apiData?.approach_section?.approach_cards && apiData.approach_section.approach_cards.length > 0 && ( + <> + {/* Desktop: Horizontal Flowchart */} +
+
+ {/* Row 1: First 3 approach cards from API */} +
+ {apiData.approach_section.approach_cards.slice(0, 3).map((card, idx) => { + const IconComponent = getIconComponent(card.icon_url); + return ( +
+
+ {IconComponent ? : } +
+

{card.title}

+

{card.description}

+ {card.bullets && card.bullets.length > 0 && ( +
+ {card.bullets.slice(0, 3).map((bullet, bulletIdx) => ( +
+ {bullet} +
+ ))} +
+ )} +
+ ); + })} - {/* Arrow 1→2 */} -
-
- -
- - {/* Pedagogy */} -
-
- + {/* Arrows between first 3 cards */} + {apiData.approach_section.approach_cards.length >= 2 && ( +
+
+ +
+ )} + {apiData.approach_section.approach_cards.length >= 3 && ( +
+
+ +
+ )}
-

Learning Pedagogy

-

- Change management and organizational learning approaches -

-
-
- Experiential Learning + + {/* Vertical Connector - Center Flow Down */} + {apiData.approach_section.approach_cards.length > 3 && ( +
+
+
+ +
-
- Change Management + )} + + {/* Row 2: Next 2 approach cards (if available) */} + {apiData.approach_section.approach_cards.length >= 4 && ( +
+ {apiData.approach_section.approach_cards.slice(3, 5).map((card, idx) => { + const IconComponent = getIconComponent(card.icon_url); + const isFirstOfPair = idx === 0; + return ( +
+
+ {IconComponent ? : } +
+

{card.title}

+

{card.description}

+ {card.bullets && card.bullets.length > 0 && ( +
+ {card.bullets.slice(0, 3).map((bullet, bulletIdx) => ( +
+ {bullet} +
+ ))} +
+ )} +
+ ); + })} + + {/* Arrow between the two cards */} + {apiData.approach_section.approach_cards.length >= 5 && ( +
+
+ +
+ )}
-
- Organizational Learning + )} + + {/* Final Vertical Connector - Center Flow Down to Outcome */} +
+
+
+
-
- {/* Arrow 2→3 */} -
-
- -
- - {/* Delivery Modes */} -
-
- -
-

Delivery Modes

-

- Multiple formats for culture and competency transformation -

-
-
- Culture Workshops -
-
- Leadership Alignment -
-
- Development Programs + {/* Row 3: Expected Outcome - Use API outcomes data */} +
+
+
+ {apiData.approach_section.outcomes && apiData.approach_section.outcomes[0] ? (() => { + const OutcomeIcon = getIconComponent(apiData.approach_section.outcomes[0].icon_url); + return OutcomeIcon ? : ; + })() : } +

+ {apiData.approach_section.outcomes?.[0]?.title || "Expected Outcome"} +

+
+

+ {apiData.approach_section.outcomes?.[0]?.description || "A systematic, measurable leadership pipeline that accelerates talent development and succession readiness."} +

+
+ {apiData.approach_section.outcomes?.[0]?.bullets && apiData.approach_section.outcomes[0].bullets.length > 0 ? ( + apiData.approach_section.outcomes[0].bullets.slice(0, 2).map((bullet, idx) => ( +
+ + {bullet} +
+ )) + ) : ( +
+ + Proven ROI on Leadership Investment +
+ )} +
- {/* Vertical Connector - Center Flow Down */} -
-
-
- -
-
+ {/* Tablet & Mobile: Vertical Flowchart */} +
+ {/* Map all approach cards vertically */} + {apiData.approach_section.approach_cards.map((card, idx) => { + const IconComponent = getIconComponent(card.icon_url); + const isEven = idx % 2 === 0; + return ( +
+
+
+ {IconComponent ? : } +
+

{card.title}

+

{card.description}

+ {card.bullets && card.bullets.length > 0 && ( +
+ {card.bullets.map((bullet, bulletIdx) => ( +
+ {bullet} +
+ ))} +
+ )} +
+ {/* Connector Arrow */} + {idx < apiData.approach_section.approach_cards.length - 1 && ( +
+ +
+ )} +
+ ); + })} - {/* Row 2: Assessment, Coaching */} -
- {/* Assessment Integration */} -
-
- -
-

Assessment Integration

-

- Comprehensive measurement to track culture transformation -

-
-
- Engagement Surveys -
-
- Culture Analytics -
-
- Progress Tracking -
-
-
- - {/* Arrow 4→5 */} -
-
- -
- - {/* Coaching Integration */} -
-
- -
-

Coaching Integration

-

- Leadership support for culture change and capability building -

-
-
- Executive Coaching -
-
- Team Coaching -
-
- Change Leadership -
-
-
-
- - {/* Final Vertical Connector - Center Flow Down to Outcome */} -
-
-
- -
-
- - {/* Row 3: Expected Outcome - Centered */} -
-
+ {/* Expected Outcome - Use API outcomes data */} +
- -

Expected Outcome

+ {apiData.approach_section.outcomes && apiData.approach_section.outcomes[0] ? (() => { + const OutcomeIcon = getIconComponent(apiData.approach_section.outcomes[0].icon_url); + return OutcomeIcon ? : ; + })() : } +

+ {apiData.approach_section.outcomes?.[0]?.title || "Expected Outcome"} +

- A thriving organizational culture aligned with strategy, powered by competencies that drive performance and engagement. + {apiData.approach_section.outcomes?.[0]?.description || "A systematic, measurable leadership pipeline that accelerates talent development and succession readiness."}

-
- - Sustainable Culture Transformation +
+ {apiData.approach_section.outcomes?.[0]?.bullets && apiData.approach_section.outcomes[0].bullets.length > 0 ? ( + apiData.approach_section.outcomes[0].bullets.slice(0, 2).map((bullet, idx) => ( +
+ + {bullet} +
+ )) + ) : ( +
+ + Proven ROI on Leadership Investment +
+ )}
-
-
- - {/* Tablet & Mobile: Vertical Flowchart */} -
- {/* Frameworks */} -
-
-
- -
-

Culture Frameworks

-

- Diagnostic models and competency frameworks for transformation -

-
-
- Culture Assessment -
-
- Competency Models -
-
- Values Alignment -
-
-
- {/* Connector Arrow */} -
- -
-
- - {/* Pedagogy */} -
-
-
- -
-

Learning Pedagogy

-

- Change management and organizational learning approaches -

-
-
- Experiential Learning -
-
- Change Management -
-
- Organizational Learning -
-
-
- {/* Connector Arrow */} -
- -
-
- - {/* Delivery Modes */} -
-
-
- -
-

Delivery Modes

-

- Multiple formats for culture and competency transformation -

-
-
- Culture Workshops -
-
- Leadership Alignment -
-
- Development Programs -
-
-
- {/* Connector Arrow */} -
- -
-
- - {/* Assessment Integration */} -
-
-
- -
-

Assessment Integration

-

- Comprehensive measurement to track culture transformation -

-
-
- Engagement Surveys -
-
- Culture Analytics -
-
- Progress Tracking -
-
-
- {/* Connector Arrow */} -
- -
-
- - {/* Coaching Integration */} -
-
-
- -
-

Coaching Integration

-

- Leadership support for culture change and capability building -

-
-
- Executive Coaching -
-
- Team Coaching -
-
- Change Leadership -
-
-
- {/* Connector Arrow */} -
- -
-
- - {/* Expected Outcome */} -
-
- -

Expected Outcome

-
-

- A thriving organizational culture aligned with strategy, powered by competencies that drive performance and engagement. -

-
- - Sustainable Culture Transformation -
-
-
+ + )}
- {/* Framework Effectiveness */} - {/*
-
-

Framework Effectiveness

-

- Our systematic approach delivers measurable results across key culture and competency metrics. -

-
- -
-
-
- -
-
87%
-

Culture Alignment Increase

+ {/* Framework Effectiveness - Stats Section */} + {apiData?.stats_section && apiData.stats_section.stat_cards && apiData.stats_section.stat_cards.length > 0 && ( +
+
+

{apiData.stats_section.title || "Framework Effectiveness"}

+

+ {apiData.stats_section.description || "Measurable results that demonstrate the impact of our leadership development approach."} +

-
-
- -
-
91%
-

Employee Engagement Growth

-
- -
-
- -
-
82%
-

Competency Development Impact

+
+ {apiData.stats_section.stat_cards.map((stat) => { + const IconComponent = getIconComponent(stat.icon_url); + return ( +
+
+ {IconComponent ? : } +
+
{stat.value || "0"}
+

{stat.label || ""}

+
+ ); + })}
-
*/} + )}
@@ -757,9 +738,9 @@ export function CultureCompetence() {
-

12-Month Culture Transformation Journey

+

{apiData.program_section?.title || 'Culture Transformation Journey'}

- A comprehensive 3-phase program designed to transform organizational culture and build strategic competencies. + {apiData.program_section?.description || 'A comprehensive program designed to transform organizational culture and build strategic competencies.'}

@@ -840,119 +821,104 @@ export function CultureCompetence() {
-

Measurable Culture & Performance Outcomes

+

{apiData.impact_section?.title || 'Measurable Culture & Performance Outcomes'}

- Organizations typically see significant improvements in engagement, culture alignment, and organizational performance. + {apiData.impact_section?.description || 'Organizations typically see significant improvements in engagement, culture alignment, and organizational performance.'}

- {/* Outcomes Grid */} -
- {expectedOutcomes.map((outcome, index) => ( - - -
- -
- {/*
- {outcome.metric} -
*/} -

{outcome.category}

- -

{outcome.description}

- {/*

{outcome.category}

*/} -
-
- ))} +
+ {apiData.impact_section?.impact_stats?.map((stat) => { + const IconComponent = getIconComponent(stat.icon_url); + return ( + + +
+ +
+
+ {stat.value} +
+

{stat.description}

+

{stat.label}

+
+
+ ); + })}
-
+

Additional Cultural Benefits

-
- -

Employee Engagement

-

Higher engagement scores and improved employee experience

-
-
- -

Strategic Alignment

-

Better alignment between culture and business strategy

-
-
- -

Business Performance

-

Improved business results through cultural transformation

-
+ {apiData.impact_section?.impact_benefits?.map((benefit) => { + const IconComponent = getIconComponent(benefit.icon_url); + return ( +
+
+ +
+

{benefit.title}

+

{benefit.description}

+
+ ); + })}
- {/* 7. Client Examples / Testimonials - Hero Section Design */} + {/* 7. Client Examples / Testimonials */} - {/* 8. CTA Section - Hero Section Design */} -
- {/* Background Image */} -
- - - {/* Subtle dark overlay for overall image */} -
- - {/* Gradient overlay for better text readability */} -
-
- - {/* Content Container */} -
- {/* CTA Content Block */} -
- {/* Branded Tag */} - - - {/* Main Headline */} -

- Ready to transform your culture? - - {" "}Get in touch{" "} - - to align strategy and performance. -

- - {/* CTA Button */} - navigateTo('/contact?topic=culture-competence')} - ariaLabel="Schedule a culture and competence consultation" + {/* 8. CTA Section */} + {apiData.cta_section && ( +
+
+ - - {/* Supporting Text */} -

- Connect with our culture transformation experts to discuss building a high-performance culture aligned with your business strategy. -

+
+
-
-
+ +
+
+ +

+ {apiData.cta_section.text} + + {" "}Get in touch{" "} + + to align strategy and performance. +

+ navigateTo(apiData.cta_section.cta_destination)} + ariaLabel={apiData.cta_section.cta_text} + /> + {apiData.cta_section.description && ( +

+ {apiData.cta_section.description} +

+ )} +
+
+
+ )}
); } \ No newline at end of file diff --git a/src/components/services/ExecutiveCoaching.tsx b/src/components/services/ExecutiveCoaching.tsx index 4aa28f9..17c5917 100644 --- a/src/components/services/ExecutiveCoaching.tsx +++ b/src/components/services/ExecutiveCoaching.tsx @@ -1,6 +1,5 @@ import React, { useEffect, useState } from 'react'; import { Button } from '../ui/button'; -import { Badge } from '../ui/badge'; import { Card, CardContent } from '../ui/card'; import { ImageWithFallback } from '../figma/ImageWithFallback'; import { navigateTo } from '../Router'; @@ -11,139 +10,290 @@ import { ArrowRight, CheckCircle, Settings, - Calendar, - Download, - Network, Users, Target, Brain, - Eye, TrendingUp, BarChart3, Award, - Lightbulb, - Shield, ChevronDown, ChevronUp, ArrowLeft, Star, - Zap, - Globe, Clock, - BookOpen, MessageCircle, - Building, Heart, Compass, + Building, User, - UserCheck + Network, + Eye } from 'lucide-react'; import { TestimonialsSection } from '../TestimonialsSection'; +import { useGetServiceListQuery } from '../../redux/services/sercicesApi'; +import { FullScreenLoader } from '../FullScreenLoader'; -const targetAudience = [ - { - title: "Senior Executives & C-Suite Leaders", - description: "CEOs, Presidents, and senior executives seeking personalized leadership development and strategic guidance", - icon: User, - challenges: ["Executive transition challenges", "Strategic decision making", "Leadership effectiveness", "Work-life integration"] - }, - { - title: "High-Potential Leaders", - description: "Emerging leaders and high-potential individuals preparing for senior leadership roles", - icon: Star, - challenges: ["Leadership readiness", "Executive presence", "Strategic thinking", "Career advancement"] - }, - { - title: "Professional Development Teams", - description: "HR and L&D professionals implementing coaching and mentoring programs organizationally", - icon: Users, - challenges: ["Program design", "Coach matching", "Impact measurement", "Scalability challenges"] - } -]; +// Types based on API response +interface ServicePageData { + hero_section: { + id: string; + landing_page_type: string; + background_image_url: string; + background_image_alt_text: string; + headline: string; + subtext: string; + cta_text: string; + cta_destination: string; + }; + overview: { + id: string; + title: string; + description: string; + highlight_text: string; + overview_cards: Array<{ + id: string; + title: string; + description: string; + icon_url: string; + accessible_label: string; + }>; + }; + audience_section: { + id: string; + title: string; + description: string; + audience_cards: Array<{ + id: string; + title: string; + description: string; + icon_url: string; + accessible_label: string; + challenges: string[]; + }>; + }; + use_case_section: { + id: string; + title: string; + description: string; + use_case_cards: Array<{ + id: string; + title: string; + description: string; + icon_url: string; + accessible_label: string; + highlight_text: string; + }>; + }; + approach_section: { + id: string; + title: string; + description: string; + approach_cards: Array<{ + id: string; + title: string; + description: string; + icon_url: string; + accessible_label: string; + bullets: string[]; + }>; + outcomes: Array<{ + id: string; + title: string; + description: string; + icon_url: string; + accessible_label: string; + bullets: string[]; + }>; + }; + stats_section: { + id: string; + title: string; + description: string; + stat_cards: Array<{ + id: string; + value: string; + label: string; + icon_url: string; + accessible_label: string; + }>; + }; + program_section: { + id: string; + title: string; + description: string; + program_phases: Array<{ + phase: { + id: string; + phase_number: number; + title: string; + duration: string; + }; + activities: Array<{ + id: string; + phase_id: string; + text: string; + }>; + outcomes: Array<{ + id: string; + phase_id: string; + text: string; + }>; + }>; + }; + impact_section: { + id: string; + title: string; + description: string; + impact_stats: Array<{ + id: string; + value: string; + description: string; + label: string; + icon_url: string; + accessible_label: string; + }>; + impact_benefits: Array<{ + id: string; + title: string; + description: string; + icon_url: string; + accessible_label: string; + }>; + }; + testimonial_section: Array<{ + id: string; + profile_xid: string; + name: string; + designation: string; + content: string; + video_url: string | null; + display_order: number; + }>; + cta_section: { + id: string; + background_image_url: string; + text: string; + cta_text: string; + cta_destination: string; + description: string; + landing_page_type: string; + service_type: string; + }; +} -const useCases = [ - { - title: "Executive Transition", - description: "When leaders need support navigating new roles or organizational changes", - icon: User, - scenario: "New executive appointments or significant role transitions" - }, - { - title: "Leadership Development", - description: "When high-potential individuals need personalized development for advancement", - icon: TrendingUp, - scenario: "Talent pipeline development and succession planning needs" - }, - { - title: "Performance Optimization", - description: "When leaders need to enhance their effectiveness and impact", - icon: Target, - scenario: "Performance gaps or need for enhanced leadership capability" - }, - { - title: "Strategic Challenges", - description: "When executives face complex business challenges requiring strategic thinking", - icon: Brain, - scenario: "Major business transformations or strategic decision-making needs" - } -]; +// Map API icons to Lucide icons +const getIconComponent = (iconUrl: string) => { + const iconMap: Record = { + '/icons/coaching.svg': MessageCircle, + '/icons/mentoring.svg': Network, + '/icons/executive.svg': User, + '/icons/leadership.svg': Award, + '/icons/growth.svg': TrendingUp, + '/icons/development.svg': Brain, + '/icons/assessment.svg': BarChart3, + '/icons/outcome.svg': Award, + '/icons/target.svg': Target, + '/icons/engagement.svg': Heart, + '/icons/people.svg': Users, + '/icons/team.svg': Users, + '/icons/compass.svg': Compass, + '/icons/eye.svg': Eye, + '/icons/network.svg': Network, + '/icons/user.svg': User, + }; -const programTimeline = [ - { - phase: "Phase 1: Assessment & Goal Setting", - duration: "Month 1", - activities: ["Leadership assessment", "Goal setting sessions", "Coach matching", "Development plan creation"], - deliverables: ["Leadership profile", "Coaching agreement", "Development roadmap", "Success metrics"] - }, - { - phase: "Phase 2: Coaching & Development", - duration: "Months 2-8", - activities: ["Regular coaching sessions", "360-degree feedback", "Action learning projects", "Progress reviews"], - deliverables: ["Enhanced leadership skills", "Behavioral changes", "Strategic insights", "Performance improvements"] - }, - { - phase: "Phase 3: Integration & Sustainability", - duration: "Months 9-12", - activities: ["Implementation support", "Mentoring relationships", "Peer learning", "Impact assessment"], - deliverables: ["Sustained behavior change", "Mentoring capability", "Leadership impact", "Continued development plan"] - } -]; - -const expectedOutcomes = [ - { - metric: "87%", - description: "Of leaders report improved leadership effectiveness", - icon: User, - category: "Leadership Impact" - }, - { - metric: "79%", - description: "Enhancement in strategic thinking and decision-making", - icon: Brain, - category: "Strategic Capability" - }, - { - metric: "92%", - description: "Satisfaction rate with coaching experience and outcomes", - icon: Heart, - category: "Program Satisfaction" - }, - { - metric: "71%", - description: "Of participants promoted within 18 months", - icon: TrendingUp, - category: "Career Advancement" - } -]; + return iconMap[iconUrl] || MessageCircle; +}; export function ExecutiveCoaching() { const [expandedUseCase, setExpandedUseCase] = useState(null); const [expandedPhase, setExpandedPhase] = useState(0); + const { data: apiResponse, isLoading, error } = useGetServiceListQuery({ + service_type: 'coaching_and_mentoring' + }); + + const apiData = apiResponse?.data as ServicePageData | undefined; + useEffect(() => { window.scrollTo(0, 0); }, []); + // Loading state + if (isLoading) { + return ( +
+ +
+ ); + } + + // Error state + if (error) { + console.error('API Error:', error); + return ( +
+
+

Error loading content. Please try again later.

+ +
+
+ ); + } + + // Check if apiData exists and has required properties + if (!apiData || !apiData.hero_section) { + return ( +
+
+

No data available for this service.

+ +
+
+ ); + } + + // Transform data for UI with safe fallbacks + const targetAudience = apiData.audience_section?.audience_cards?.map(card => ({ + title: card.title || '', + description: card.description || '', + icon: getIconComponent(card.icon_url), + challenges: card.challenges || [] + })) || []; + + const useCases = apiData.use_case_section?.use_case_cards?.map(card => ({ + title: card.title || '', + description: card.description || '', + icon: getIconComponent(card.icon_url), + scenario: card.highlight_text || '' + })) || []; + + const programTimeline = apiData.program_section?.program_phases?.map(phase => ({ + phase: phase.phase?.title || '', + duration: phase.phase?.duration || '', + activities: phase.activities?.map(activity => activity.text) || [], + deliverables: phase.outcomes?.map(outcome => outcome.text) || [] + })) || []; + + const testimonials = apiData.testimonial_section?.map(testimonial => { + const designationParts = testimonial.designation?.split(',') || []; + const role = designationParts[0]?.trim() || ''; + const company = designationParts[1]?.trim() || ''; + + return { + id: parseInt(testimonial.id) || 0, + name: testimonial.name || '', + role: role, + company: company, + avatar: `https://ui-avatars.com/api/?name=${encodeURIComponent(testimonial.name || 'User')}&background=04045B&color=fff&size=128`, + quote: testimonial.content || '', + rating: 5, + isVideo: !!testimonial.video_url, + videoThumbnail: testimonial.video_url ? `/images/testimonials/thumbnails/${testimonial.id}.jpg` : undefined, + videoUrl: testimonial.video_url || undefined + }; + }) || []; + return (
{/* Hero Section */} @@ -152,7 +302,7 @@ export function ExecutiveCoaching() {
@@ -161,7 +311,6 @@ export function ExecutiveCoaching() {
- {/* Back Navigation */}

- Develop exceptional leaders through personalized coaching that drives 87% improvement in leadership effectiveness and accelerates career advancement. + {apiData.hero_section.subtext || 'Develop exceptional leaders through personalized coaching that drives leadership effectiveness and accelerates career advancement.'}

navigateTo('/contact?topic=coaching-mentoring')} - ariaLabel="Book a consultation for coaching and mentoring" + text={apiData.hero_section.cta_text || 'Book a Consultation'} + onClick={() => navigateTo(apiData.hero_section.cta_destination || '/contact')} + ariaLabel={apiData.hero_section.cta_text || 'Book a Consultation'} className="primary-cta-button-blue cta-text-white" />
@@ -202,70 +351,41 @@ export function ExecutiveCoaching() {
-

Personalized Leadership Development

+

{apiData.overview?.title || 'Personalized Leadership Development'}

- Coaching & Mentoring is a personalized leadership development approach that combines one-on-one executive coaching with strategic mentoring relationships. Our certified coaches work with leaders to enhance their effectiveness, navigate complex challenges, and accelerate their professional growth through tailored development experiences. + {apiData.overview?.description || 'Coaching & Mentoring is a personalized leadership development approach that combines one-on-one executive coaching with strategic mentoring relationships. Our certified coaches work with leaders to enhance their effectiveness, navigate complex challenges, and accelerate their professional growth through tailored development experiences.'}

- The Business Problem It Solves: Many talented leaders struggle to reach their full potential due to lack of personalized guidance, limited feedback, and insufficient support during critical transitions. Our coaching and mentoring programs provide the individualized attention and expertise needed for exceptional leadership development. + The Business Problem It Solves: {apiData.overview?.highlight_text || 'Many talented leaders struggle to reach their full potential due to lack of personalized guidance, limited feedback, and insufficient support during critical transitions. Our coaching and mentoring programs provide the individualized attention and expertise needed for exceptional leadership development.'}

-
-
-
- + {apiData.overview?.overview_cards?.map((card, index) => { + const IconComponent = getIconComponent(card.icon_url); + return ( +
+
+
+ +
+

+ {card.title} +

+

+ {card.description} +

+
-

- Executive Coaching -

-

- Personalized coaching for senior leaders and executives to enhance performance and impact -

-
-
- -
-
-
- -
-

- Strategic Mentoring -

-

- Long-term mentoring relationships for career development and leadership growth -

-
-
- -
-
-
- -
-

- 87% Success Rate -

-

- Proven track record with 87% of leaders reporting improved effectiveness and performance -

-
-
+ ); + })}
@@ -277,9 +397,9 @@ export function ExecutiveCoaching() {
-

Target Audience

+

{apiData.audience_section?.title || 'Target Audience'}

- Designed for senior leaders, high-potential individuals, and organizations investing in personalized leadership development. + {apiData.audience_section?.description || 'Designed for senior leaders, high-potential individuals, and organizations investing in personalized leadership development.'}

@@ -322,9 +442,9 @@ export function ExecutiveCoaching() {
-

Use Case Scenarios

+

{apiData.use_case_section?.title || 'Use Case Scenarios'}

- Coaching & Mentoring is most effective in these critical leadership development situations. + {apiData.use_case_section?.description || 'Coaching & Mentoring is most effective in these critical leadership development situations.'}

@@ -377,380 +497,245 @@ export function ExecutiveCoaching() {
-

Comprehensive Coaching & Mentoring Framework

+

+ {apiData?.approach_section?.title || "Our Approach to Leadership Development"} +

- Our proven methodology combines individual coaching, strategic mentoring, and continuous development for sustainable leadership growth. + {apiData?.approach_section?.description || "A systematic, research-backed methodology that transforms leadership potential into measurable business impact."}

{/* Flowchart Container with Connecting Lines */}
- {/* Desktop: Horizontal Flowchart */} -
-
- {/* Row 1: Frameworks, Pedagogy, Delivery */} -
- {/* Frameworks */} -
-
- -
-

Assessment Frameworks

-

- Comprehensive profiling and leadership capability evaluation -

-
-
- Leadership Profiling -
-
- 360° Feedback -
-
- Psychometric Tools -
-
-
+ {/* Only render if approach_cards exist and have items */} + {apiData?.approach_section?.approach_cards && apiData.approach_section.approach_cards.length > 0 && ( + <> + {/* Desktop: Horizontal Flowchart */} +
+
+ {/* Row 1: First 3 approach cards from API */} +
+ {apiData.approach_section.approach_cards.slice(0, 3).map((card, idx) => { + const IconComponent = getIconComponent(card.icon_url); + return ( +
+
+ {IconComponent ? : } +
+

{card.title}

+

{card.description}

+ {card.bullets && card.bullets.length > 0 && ( +
+ {card.bullets.slice(0, 3).map((bullet, bulletIdx) => ( +
+ {bullet} +
+ ))} +
+ )} +
+ ); + })} - {/* Arrow 1→2 */} -
-
- -
- - {/* Pedagogy */} -
-
- + {/* Arrows between first 3 cards */} + {apiData.approach_section.approach_cards.length >= 2 && ( +
+
+ +
+ )} + {apiData.approach_section.approach_cards.length >= 3 && ( +
+
+ +
+ )}
-

Coaching Pedagogy

-

- Evidence-based coaching methodologies for transformation -

-
-
- Solution-Focused + + {/* Vertical Connector - Center Flow Down */} + {apiData.approach_section.approach_cards.length > 3 && ( +
+
+
+ +
-
- Strengths-Based + )} + + {/* Row 2: Next 2 approach cards (if available) */} + {apiData.approach_section.approach_cards.length >= 4 && ( +
+ {apiData.approach_section.approach_cards.slice(3, 5).map((card, idx) => { + const IconComponent = getIconComponent(card.icon_url); + const isFirstOfPair = idx === 0; + return ( +
+
+ {IconComponent ? : } +
+

{card.title}

+

{card.description}

+ {card.bullets && card.bullets.length > 0 && ( +
+ {card.bullets.slice(0, 3).map((bullet, bulletIdx) => ( +
+ {bullet} +
+ ))} +
+ )} +
+ ); + })} + + {/* Arrow between the two cards */} + {apiData.approach_section.approach_cards.length >= 5 && ( +
+
+ +
+ )}
-
- Goal-Oriented + )} + + {/* Final Vertical Connector - Center Flow Down to Outcome */} +
+
+
+
-
- {/* Arrow 2→3 */} -
-
- -
- - {/* Delivery Modes */} -
-
- -
-

Delivery Modes

-

- Flexible coaching formats for executive schedules -

-
-
- One-on-One Coaching -
-
- Virtual & In-Person -
-
- Mentoring Circles + {/* Row 3: Expected Outcome - Use API outcomes data */} +
+
+
+ {apiData.approach_section.outcomes && apiData.approach_section.outcomes[0] ? (() => { + const OutcomeIcon = getIconComponent(apiData.approach_section.outcomes[0].icon_url); + return OutcomeIcon ? : ; + })() : } +

+ {apiData.approach_section.outcomes?.[0]?.title || "Expected Outcome"} +

+
+

+ {apiData.approach_section.outcomes?.[0]?.description || "A systematic, measurable leadership pipeline that accelerates talent development and succession readiness."} +

+
+ {apiData.approach_section.outcomes?.[0]?.bullets && apiData.approach_section.outcomes[0].bullets.length > 0 ? ( + apiData.approach_section.outcomes[0].bullets.slice(0, 2).map((bullet, idx) => ( +
+ + {bullet} +
+ )) + ) : ( +
+ + Proven ROI on Leadership Investment +
+ )} +
- {/* Vertical Connector - Center Flow Down */} -
-
-
- -
-
+ {/* Tablet & Mobile: Vertical Flowchart */} +
+ {/* Map all approach cards vertically */} + {apiData.approach_section.approach_cards.map((card, idx) => { + const IconComponent = getIconComponent(card.icon_url); + const isEven = idx % 2 === 0; + return ( +
+
+
+ {IconComponent ? : } +
+

{card.title}

+

{card.description}

+ {card.bullets && card.bullets.length > 0 && ( +
+ {card.bullets.map((bullet, bulletIdx) => ( +
+ {bullet} +
+ ))} +
+ )} +
+ {/* Connector Arrow */} + {idx < apiData.approach_section.approach_cards.length - 1 && ( +
+ +
+ )} +
+ ); + })} - {/* Row 2: Assessment, Coaching */} -
- {/* Progress Tracking */} -
-
- -
-

Progress Tracking

-

- Continuous measurement of development and impact -

-
-
- Goal Achievement -
-
- Behavior Change -
-
- Impact Metrics -
-
-
- - {/* Arrow 4→5 */} -
-
- -
- - {/* Mentoring Integration */} -
-
- -
-

Mentoring Integration

-

- Strategic guidance for long-term career development -

-
-
- Senior Mentors -
-
- Peer Networks -
-
- Career Strategy -
-
-
-
- - {/* Final Vertical Connector - Center Flow Down to Outcome */} -
-
-
- -
-
- - {/* Row 3: Expected Outcome - Centered */} -
-
+ {/* Expected Outcome - Use API outcomes data */} +
- -

Expected Outcome

+ {apiData.approach_section.outcomes && apiData.approach_section.outcomes[0] ? (() => { + const OutcomeIcon = getIconComponent(apiData.approach_section.outcomes[0].icon_url); + return OutcomeIcon ? : ; + })() : } +

+ {apiData.approach_section.outcomes?.[0]?.title || "Expected Outcome"} +

- Accelerated leadership development with sustained behavior change, enhanced performance, and career advancement. + {apiData.approach_section.outcomes?.[0]?.description || "A systematic, measurable leadership pipeline that accelerates talent development and succession readiness."}

-
- - Transformational Leadership Growth +
+ {apiData.approach_section.outcomes?.[0]?.bullets && apiData.approach_section.outcomes[0].bullets.length > 0 ? ( + apiData.approach_section.outcomes[0].bullets.slice(0, 2).map((bullet, idx) => ( +
+ + {bullet} +
+ )) + ) : ( +
+ + Proven ROI on Leadership Investment +
+ )}
-
-
- - {/* Tablet & Mobile: Vertical Flowchart */} -
- {/* Frameworks */} -
-
-
- -
-

Assessment Frameworks

-

- Comprehensive profiling and leadership capability evaluation -

-
-
- Leadership Profiling -
-
- 360° Feedback -
-
- Psychometric Tools -
-
-
- {/* Connector Arrow */} -
- -
-
- - {/* Pedagogy */} -
-
-
- -
-

Coaching Pedagogy

-

- Evidence-based coaching methodologies for transformation -

-
-
- Solution-Focused -
-
- Strengths-Based -
-
- Goal-Oriented -
-
-
- {/* Connector Arrow */} -
- -
-
- - {/* Delivery Modes */} -
-
-
- -
-

Delivery Modes

-

- Flexible coaching formats for executive schedules -

-
-
- One-on-One Coaching -
-
- Virtual & In-Person -
-
- Mentoring Circles -
-
-
- {/* Connector Arrow */} -
- -
-
- - {/* Progress Tracking */} -
-
-
- -
-

Progress Tracking

-

- Continuous measurement of development and impact -

-
-
- Goal Achievement -
-
- Behavior Change -
-
- Impact Metrics -
-
-
- {/* Connector Arrow */} -
- -
-
- - {/* Mentoring Integration */} -
-
-
- -
-

Mentoring Integration

-

- Strategic guidance for long-term career development -

-
-
- Senior Mentors -
-
- Peer Networks -
-
- Career Strategy -
-
-
- {/* Connector Arrow */} -
- -
-
- - {/* Expected Outcome */} -
-
- -

Expected Outcome

-
-

- Accelerated leadership development with sustained behavior change, enhanced performance, and career advancement. -

-
- - Transformational Leadership Growth -
-
-
+ + )}
- {/* Framework Effectiveness */} - {/*
-
-

Framework Effectiveness

-

- Our systematic approach delivers measurable results across key coaching and mentoring metrics. -

-
- -
-
-
- -
-
94%
-

Goal Achievement Rate

+ {/* Framework Effectiveness - Stats Section */} + {apiData?.stats_section && apiData.stats_section.stat_cards && apiData.stats_section.stat_cards.length > 0 && ( +
+
+

{apiData.stats_section.title || "Framework Effectiveness"}

+

+ {apiData.stats_section.description || "Measurable results that demonstrate the impact of our leadership development approach."} +

-
-
- -
-
88%
-

Leadership Effectiveness Growth

-
- -
-
- -
-
86%
-

Career Advancement Success

+
+ {apiData.stats_section.stat_cards.map((stat) => { + const IconComponent = getIconComponent(stat.icon_url); + return ( +
+
+ {IconComponent ? : } +
+
{stat.value || "0"}
+

{stat.label || ""}

+
+ ); + })}
-
*/} + )}
@@ -762,9 +747,9 @@ export function ExecutiveCoaching() {
-

12-Month Coaching & Mentoring Journey

+

{apiData.program_section?.title || 'Coaching & Mentoring Journey'}

- A comprehensive 3-phase program designed to accelerate leadership development and career advancement. + {apiData.program_section?.description || 'A comprehensive program designed to accelerate leadership development and career advancement.'}

@@ -845,119 +830,104 @@ export function ExecutiveCoaching() {
-

Measurable Coaching Outcomes

+

{apiData.impact_section?.title || 'Measurable Coaching Outcomes'}

- Leaders typically see significant improvements in effectiveness, strategic capability, and career advancement. + {apiData.impact_section?.description || 'Leaders typically see significant improvements in effectiveness, strategic capability, and career advancement.'}

- {/* Outcomes Grid */} -
- {expectedOutcomes.map((outcome, index) => ( - - -
- -
- {/*
- {outcome.metric} -
*/} -

{outcome.category}

- -

{outcome.description}

- {/*

{outcome.category}

*/} -
-
- ))} +
+ {apiData.impact_section?.impact_stats?.map((stat) => { + const IconComponent = getIconComponent(stat.icon_url); + return ( + + +
+ +
+
+ {stat.value} +
+

{stat.description}

+

{stat.label}

+
+
+ ); + })}
-
+

Additional Coaching Benefits

-
- -

Enhanced Communication

-

Improved leadership communication and interpersonal skills

-
-
- -

Goal Achievement

-

Better focus and achievement of personal and professional goals

-
-
- -

Strategic Clarity

-

Enhanced strategic thinking and decision-making capability

-
+ {apiData.impact_section?.impact_benefits?.map((benefit) => { + const IconComponent = getIconComponent(benefit.icon_url); + return ( +
+
+ +
+

{benefit.title}

+

{benefit.description}

+
+ ); + })}
- {/* 7. Client Examples / Testimonials - Hero Section Design */} + {/* 7. Client Examples / Testimonials */} - {/* 8. CTA Section - Hero Section Design */} -
- {/* Background Image */} -
- - - {/* Subtle dark overlay for overall image */} -
- - {/* Gradient overlay for better text readability */} -
-
- - {/* Content Container */} -
- {/* CTA Content Block */} -
- {/* Branded Tag */} - - - {/* Main Headline */} -

- Ready to accelerate your leadership? - - {" "}Get in touch{" "} - - for personalized coaching now. -

- - {/* CTA Button */} - navigateTo('/contact?topic=coaching-mentoring')} - ariaLabel="Schedule a coaching and mentoring consultation" + {/* 8. CTA Section */} + {apiData.cta_section && ( +
+
+ - - {/* Supporting Text */} -

- Connect with our executive coaching experts to discuss personalized leadership development that transforms your effectiveness and career trajectory. -

+
+
-
-
+ +
+
+ +

+ {apiData.cta_section.text} + + {" "}Get in touch{" "} + + for personalized coaching now. +

+ navigateTo(apiData.cta_section.cta_destination)} + ariaLabel={apiData.cta_section.cta_text} + /> + {apiData.cta_section.description && ( +

+ {apiData.cta_section.description} +

+ )} +
+
+
+ )}
); } \ No newline at end of file diff --git a/src/components/services/LeadershipDevelopment.tsx b/src/components/services/LeadershipDevelopment.tsx index ba45f35..b634a16 100644 --- a/src/components/services/LeadershipDevelopment.tsx +++ b/src/components/services/LeadershipDevelopment.tsx @@ -35,114 +35,265 @@ import { Clock, MessageCircle, Building, - UserCheck + UserCheck, + Heart } from 'lucide-react'; import { TestimonialsSection } from '../TestimonialsSection'; +import { useGetServiceListQuery } from '../../redux/services/sercicesApi'; +import { FullScreenLoader } from '../FullScreenLoader'; -const targetAudience = [ - { - title: "C-Suite Executives", - description: "CEOs, Presidents, and C-level executives leading organizational transformation and strategic initiatives", - icon: Crown, - challenges: ["Strategic leadership complexity", "Board accountability", "Organizational transformation", "Executive presence"] - }, - { - title: "Senior Directors & VPs", - description: "Senior leaders responsible for major business units and strategic functions across the organization", - icon: Users2, - challenges: ["Cross-functional leadership", "Strategic execution", "P&L responsibility", "Stakeholder management"] - }, - { - title: "High-Potential Leaders", - description: "Emerging leaders identified for accelerated development and future executive roles", - icon: Star, - challenges: ["Executive readiness", "Leadership capability gaps", "Career advancement", "Strategic thinking"] - } -]; +// Types based on API response +interface ServicePageData { + hero_section: { + id: string; + landing_page_type: string; + background_image_url: string; + background_image_alt_text: string; + headline: string; + subtext: string; + cta_text: string; + cta_destination: string; + }; + overview: { + id: string; + title: string; + description: string; + highlight_text: string; + overview_cards: Array<{ + id: string; + title: string; + description: string; + icon_url: string; + accessible_label: string; + }>; + }; + audience_section: { + id: string; + title: string; + description: string; + audience_cards: Array<{ + id: string; + title: string; + description: string; + icon_url: string; + accessible_label: string; + challenges: string[]; + }>; + }; + use_case_section: { + id: string; + title: string; + description: string; + use_case_cards: Array<{ + id: string; + title: string; + description: string; + icon_url: string; + accessible_label: string; + highlight_text: string; + }>; + }; + approach_section: { + id: string; + title: string; + description: string; + approach_cards: Array<{ + id: string; + title: string; + description: string; + icon_url: string; + accessible_label: string; + bullets: string[]; + }>; + outcomes: Array<{ + id: string; + title: string; + description: string; + icon_url: string; + accessible_label: string; + bullets: string[]; + }>; + }; + stats_section: { + id: string; + title: string; + description: string; + stat_cards: Array<{ + id: string; + value: string; + label: string; + icon_url: string; + accessible_label: string; + }>; + }; + program_section: { + id: string; + title: string; + description: string; + program_phases: Array<{ + phase: { + id: string; + phase_number: number; + title: string; + duration: string; + }; + activities: Array<{ + id: string; + phase_id: string; + text: string; + }>; + outcomes: Array<{ + id: string; + phase_id: string; + text: string; + }>; + }>; + }; + impact_section: { + id: string; + title: string; + description: string; + impact_stats: Array<{ + id: string; + value: string; + description: string; + label: string; + icon_url: string; + accessible_label: string; + }>; + impact_benefits: Array<{ + id: string; + title: string; + description: string; + icon_url: string; + accessible_label: string; + }>; + }; + testimonial_section: Array<{ + id: string; + profile_xid: string; + name: string; + designation: string; + content: string; + video_url: string | null; + display_order: number; + }>; + cta_section: { + id: string; + background_image_url: string; + text: string; + cta_text: string; + cta_destination: string; + description: string; + landing_page_type: string; + service_type: string; + }; +} -const useCases = [ - { - title: "Leadership Effectiveness Gap", - description: "When current leadership capabilities don't match organizational strategic needs", - icon: Target, - scenario: "Leadership effectiveness scores below industry benchmarks" - }, - { - title: "Strategic Transformation", - description: "When organizations undergo major strategic shifts requiring enhanced leadership capability", - icon: TrendingUp, - scenario: "Digital transformation, M&A, or business model changes" - }, - { - title: "Executive Presence Development", - description: "When leaders need to strengthen influence, communication, and stakeholder confidence", - icon: Crown, - scenario: "Promotion to C-suite or board-level responsibilities" - }, - { - title: "Organizational Performance", - description: "When leadership development is needed to drive measurable business results", - icon: BarChart3, - scenario: "Performance gaps in key business metrics or strategic goals" - } -]; +// Map API icons to Lucide icons +const getIconComponent = (iconUrl: string) => { + const iconMap: Record = { + '/icons/pipeline.svg': TrendingUp, + '/icons/succession.svg': Users, + '/icons/capability.svg': Brain, + '/icons/hr.svg': Users2, + '/icons/management.svg': Crown, + '/icons/growth.svg': TrendingUp, + '/icons/gap.svg': Target, + '/icons/assessment.svg': BarChart3, + '/icons/development.svg': Brain, + '/icons/outcome.svg': Award, + '/icons/target.svg': Target, + '/icons/engagement.svg': Heart, + '/icons/leader.svg': Crown, + '/icons/productivity.svg': TrendingUp, + '/icons/performance.svg': TrendingUp, + }; -const programTimeline = [ - { - phase: "Phase 1: Assessment & Design", - duration: "Months 1-2", - activities: ["360-degree leadership assessment", "Strategic leadership competency evaluation", "Executive presence analysis", "Custom program design"], - deliverables: ["Leadership assessment report", "Development roadmap", "Program curriculum", "Success metrics"] - }, - { - phase: "Phase 2: Core Development", - duration: "Months 3-6", - activities: ["Executive leadership workshops", "Strategic thinking development", "Leadership simulations", "Peer learning circles"], - deliverables: ["Enhanced strategic capability", "Leadership toolkit", "Peer network", "Action learning projects"] - }, - { - phase: "Phase 3: Application & Integration", - duration: "Months 7-12", - activities: ["Executive coaching sessions", "Real-world application", "Stakeholder feedback", "Continuous improvement"], - deliverables: ["Measurable leadership improvement", "Business impact results", "Sustainability plan", "Long-term development strategy"] - } -]; - -const expectedOutcomes = [ - { - metric: "94%", - description: "Of executives show improved strategic leadership effectiveness", - icon: Compass, - category: "Strategic Leadership" - }, - { - metric: "91%", - description: "Improvement in executive presence and stakeholder confidence", - icon: Crown, - category: "Executive Presence" - }, - { - metric: "83%", - description: "Improvement in organizational performance metrics", - icon: TrendingUp, - category: "Business Impact" - }, - { - metric: "87%", - description: "Of participants promoted within 18 months", - icon: Star, - category: "Career Advancement" - } -]; + const IconComponent = iconMap[iconUrl] || Target; + return IconComponent; +}; export function LeadershipDevelopment() { - const [expandedUseCase, setExpandedUseCase] = useState(null); const [expandedPhase, setExpandedPhase] = useState(0); + const { data: apiResponse, isLoading, error } = useGetServiceListQuery({ + service_type: 'leadership_development' + }); + + const apiData = apiResponse?.data as ServicePageData | undefined; + useEffect(() => { window.scrollTo(0, 0); }, []); + if (isLoading) { + return ( +
+ +
+ ); + } + + if (error || !apiData) { + return ( +
+
+

Error loading content. Please try again later.

+ +
+
+ ); + } + + // Transform data for UI + const targetAudience = apiData.audience_section?.audience_cards.map(card => ({ + title: card.title, + description: card.description, + icon: getIconComponent(card.icon_url), + challenges: card.challenges || [] + })) || []; + + const useCases = apiData.use_case_section?.use_case_cards.map(card => ({ + title: card.title, + description: card.description, + icon: getIconComponent(card.icon_url), + scenario: card.highlight_text + })) || []; + + const programTimeline = apiData.program_section?.program_phases.map(phase => ({ + phase: phase.phase.title, + duration: phase.phase.duration, + activities: phase.activities.map(activity => activity.text), + deliverables: phase.outcomes.map(outcome => outcome.text) + })) || []; + + const expectedOutcomes = apiData.impact_section?.impact_benefits.map(benefit => ({ + metric: apiData.impact_section?.impact_stats[0]?.value || '85%', + description: benefit.description, + icon: getIconComponent(benefit.icon_url), + category: benefit.title + })) || []; + + const testimonials = apiData.testimonial_section?.map(testimonial => { + const designationParts = testimonial.designation.split(','); + const role = designationParts[0]?.trim() || ''; + const company = designationParts[1]?.trim() || ''; + + return { + id: parseInt(testimonial.id) || 0, + name: testimonial.name, + role: role, + company: company, + avatar: `https://ui-avatars.com/api/?name=${encodeURIComponent(testimonial.name)}&background=04045B&color=fff&size=128`, + quote: testimonial.content, + rating: 5, + isVideo: !!testimonial.video_url, + videoThumbnail: testimonial.video_url ? `/images/testimonials/thumbnails/${testimonial.id}.jpg` : undefined, + videoUrl: testimonial.video_url || undefined + }; + }) || []; + return (
{/* Hero Section */} @@ -151,7 +302,7 @@ export function LeadershipDevelopment() {
@@ -160,7 +311,6 @@ export function LeadershipDevelopment() {
- {/* Back Navigation */}

- Transform senior executives into visionary leaders who drive 94% better strategic outcomes and organizational performance. + {apiData.hero_section.subtext}

navigateTo('/contact?topic=leadership-development')} - ariaLabel="Book a consultation for leadership development" + text={apiData.hero_section.cta_text} + onClick={() => navigateTo(apiData.hero_section.cta_destination)} + ariaLabel={apiData.hero_section.cta_text} className="primary-cta-button-blue cta-text-white" />
@@ -201,70 +351,41 @@ export function LeadershipDevelopment() {
-

Executive Leadership Development

+

{apiData.overview.title}

- Leadership Development is a comprehensive executive transformation program designed to elevate senior leaders' strategic thinking, executive presence, and organizational impact. Our approach combines proven leadership frameworks with real-world application to create visionary leaders who drive exceptional business results. + {apiData.overview.description}

- The Business Problem It Solves: Many talented leaders struggle to reach their full potential due to lack of personalized guidance, limited feedback, and insufficient support during critical transitions. Traditional leadership training often fails to address the complex challenges executives face in today's dynamic business environment. + The Business Problem It Solves: {apiData.overview.highlight_text}

-
-
-
- + {apiData.overview.overview_cards.map((card, index) => { + const IconComponent = getIconComponent(card.icon_url); + return ( +
+
+
+ +
+

+ {card.title} +

+

+ {card.description} +

+
-

- Executive Excellence -

-

- Comprehensive development for C-suite and senior leaders focused on strategic transformation -

-
-
- -
-
-
- -
-

- Strategic Impact -

-

- Focus on measurable business results and organizational performance improvements -

-
-
- -
-
-
- -
-

- 94% Success Rate -

-

- Proven track record with 94% of executives showing improved strategic leadership effectiveness -

-
-
+ ); + })}
@@ -276,9 +397,9 @@ export function LeadershipDevelopment() {
-

Target Audience

+

{apiData.audience_section.title}

- Designed for senior executives and high-potential leaders who drive organizational strategy and transformation. + {apiData.audience_section.description}

@@ -321,9 +442,9 @@ export function LeadershipDevelopment() {
-

When Organizations Need Executive Leadership Development

+

{apiData.use_case_section.title}

- Ideal for organizations seeking to elevate strategic leadership and drive transformational change. + {apiData.use_case_section.description}

@@ -333,7 +454,6 @@ export function LeadershipDevelopment() { key={index} className="bg-white rounded-xl border border-gray-200 p-6 hover:border-[#04045B] hover:shadow-lg transition-all duration-300" > - {/* Icon and Title */}
- {/* Trigger Indicator */}
@@ -372,9 +491,9 @@ export function LeadershipDevelopment() {
-

Comprehensive Executive Leadership Framework

+

{apiData.approach_section.title}

- Our proven methodology combines strategic assessment, executive coaching, experiential learning, and real-world application. + {apiData.approach_section.description}

@@ -383,85 +502,41 @@ export function LeadershipDevelopment() { {/* Desktop: Horizontal Flowchart */}
- {/* Row 1: Frameworks, Pedagogy, Delivery */} + {/* Row 1: First 3 approach cards from API */}
- {/* Frameworks */} -
-
- -
-

Strategic Frameworks

-

- Executive leadership models and strategic thinking frameworks -

-
-
- Leadership Models + {apiData.approach_section.approach_cards.slice(0, 3).map((card, idx) => { + const IconComponent = getIconComponent(card.icon_url); + return ( +
+
+ +
+

{card.title}

+

{card.description}

+
+ {card.bullets.slice(0, 3).map((bullet, bulletIdx) => ( +
+ {bullet} +
+ ))} +
-
- Strategic Thinking -
-
- Vision Creation -
-
-
+ ); + })} - {/* Arrow 1→2 */} -
-
- -
- - {/* Pedagogy */} -
-
- + {/* Arrows between first 3 cards */} + {apiData.approach_section.approach_cards.length >= 2 && ( +
+
+
-

Learning Pedagogy

-

- Executive development through experiential and action learning -

-
-
- Experiential Learning -
-
- Action Learning -
-
- Peer Learning -
+ )} + {apiData.approach_section.approach_cards.length >= 3 && ( +
+
+
-
- - {/* Arrow 2→3 */} -
-
- -
- - {/* Delivery Modes */} -
-
- -
-

Delivery Modes

-

- Flexible formats designed for executive schedules -

-
-
- Executive Workshops -
-
- Leadership Simulations -
-
- Strategic Projects -
-
-
+ )}
{/* Vertical Connector - Center Flow Down */} @@ -472,58 +547,39 @@ export function LeadershipDevelopment() {
- {/* Row 2: Assessment, Coaching */} -
- {/* Assessment Integration */} -
-
- -
-

Assessment Integration

-

- Comprehensive evaluation to measure executive readiness -

-
-
- 360° Feedback -
-
- Leadership Assessment -
-
- Impact Measurement -
-
-
+ {/* Row 2: Next 2 approach cards (if available) */} + {apiData.approach_section.approach_cards.length >= 4 && ( +
+ {apiData.approach_section.approach_cards.slice(3, 5).map((card, idx) => { + const IconComponent = getIconComponent(card.icon_url); + const isFirstOfPair = idx === 0; + return ( +
+
+ +
+

{card.title}

+

{card.description}

+
+ {card.bullets.slice(0, 3).map((bullet, bulletIdx) => ( +
+ {bullet} +
+ ))} +
+
+ ); + })} - {/* Arrow 4→5 */} -
-
- + {/* Arrow between the two cards */} + {apiData.approach_section.approach_cards.length >= 5 && ( +
+
+ +
+ )}
- - {/* Coaching Integration */} -
-
- -
-

Coaching Integration

-

- Personalized executive coaching throughout development -

-
-
- Executive Coaching -
-
- Strategic Advisement -
-
- Peer Coaching -
-
-
-
+ )} {/* Final Vertical Connector - Center Flow Down to Outcome */}
@@ -533,19 +589,35 @@ export function LeadershipDevelopment() {
- {/* Row 3: Expected Outcome - Centered */} + {/* Row 3: Expected Outcome - Use API outcomes data */}
- -

Expected Outcome

+ {apiData.approach_section.outcomes && apiData.approach_section.outcomes[0] && (() => { + const OutcomeIcon = getIconComponent(apiData.approach_section.outcomes[0].icon_url); + return ; + })() || } +

+ {apiData.approach_section.outcomes?.[0]?.title || "Expected Outcome"} +

- Transformational executive leaders with strategic capability, executive presence, and proven business impact. + {apiData.approach_section.outcomes?.[0]?.description || "Transformational executive leaders with strategic capability, executive presence, and proven business impact."}

-
- - Enhanced Leadership Effectiveness +
+ {apiData.approach_section.outcomes?.[0]?.bullets?.slice(0, 2).map((bullet, idx) => ( +
+ + {bullet} +
+ )) || ( + <> +
+ + Enhanced Leadership Effectiveness +
+ + )}
@@ -554,198 +626,95 @@ export function LeadershipDevelopment() { {/* Tablet & Mobile: Vertical Flowchart */}
- {/* Frameworks */} -
-
-
- + {/* Map all approach cards vertically */} + {apiData.approach_section.approach_cards.map((card, idx) => { + const IconComponent = getIconComponent(card.icon_url); + const isEven = idx % 2 === 0; + return ( +
+
+
+ +
+

{card.title}

+

{card.description}

+
+ {card.bullets.map((bullet, bulletIdx) => ( +
+ {bullet} +
+ ))} +
+
+ {/* Connector Arrow */} + {idx < apiData.approach_section.approach_cards.length - 1 && ( +
+ +
+ )}
-

Strategic Frameworks

-

- Executive leadership models and strategic thinking frameworks -

-
-
- Leadership Models -
-
- Strategic Thinking -
-
- Vision Creation -
-
-
- {/* Connector Arrow */} -
- -
-
+ ); + })} - {/* Pedagogy */} -
-
-
- -
-

Learning Pedagogy

-

- Executive development through experiential and action learning -

-
-
- Experiential Learning -
-
- Action Learning -
-
- Peer Learning -
-
-
- {/* Connector Arrow */} -
- -
-
- - {/* Delivery Modes */} -
-
-
- -
-

Delivery Modes

-

- Flexible formats designed for executive schedules -

-
-
- Executive Workshops -
-
- Leadership Simulations -
-
- Strategic Projects -
-
-
- {/* Connector Arrow */} -
- -
-
- - {/* Assessment Integration */} -
-
-
- -
-

Assessment Integration

-

- Comprehensive evaluation to measure executive readiness -

-
-
- 360° Feedback -
-
- Leadership Assessment -
-
- Impact Measurement -
-
-
- {/* Connector Arrow */} -
- -
-
- - {/* Coaching Integration */} -
-
-
- -
-

Coaching Integration

-

- Personalized executive coaching throughout development -

-
-
- Executive Coaching -
-
- Strategic Advisement -
-
- Peer Coaching -
-
-
- {/* Connector Arrow */} -
- -
-
- - {/* Expected Outcome */} + {/* Expected Outcome - Use API outcomes data */}
- -

Expected Outcome

+ {apiData.approach_section.outcomes && apiData.approach_section.outcomes[0] && (() => { + const OutcomeIcon = getIconComponent(apiData.approach_section.outcomes[0].icon_url); + return ; + })() || } +

+ {apiData.approach_section.outcomes?.[0]?.title || "Expected Outcome"} +

- Transformational executive leaders with strategic capability, executive presence, and proven business impact. + {apiData.approach_section.outcomes?.[0]?.description || "Transformational executive leaders with strategic capability, executive presence, and proven business impact."}

-
- - Enhanced Leadership Effectiveness +
+ {apiData.approach_section.outcomes?.[0]?.bullets?.slice(0, 2).map((bullet, idx) => ( +
+ + {bullet} +
+ )) || ( + <> +
+ + Enhanced Leadership Effectiveness +
+ + )}
- {/* Framework Effectiveness */} - {/*
-
-

Framework Effectiveness

-

- Our systematic approach delivers measurable results across key leadership development metrics. -

-
- -
-
-
- -
-
92%
-

Leadership Effectiveness Increase

+ {/* Framework Effectiveness - Stats Section */} + {apiData.stats_section && ( +
+
+

{apiData.stats_section.title}

+

+ {apiData.stats_section.description} +

- -
-
- -
-
88%
-

Executive Presence Enhancement

-
- -
-
- -
-
85%
-

Strategic Impact Improvement

+ +
+ {apiData.stats_section.stat_cards.map((stat) => { + const IconComponent = getIconComponent(stat.icon_url); + return ( +
+
+ +
+
{stat.value}
+

{stat.label}

+
+ ); + })}
-
*/} + )}
@@ -757,9 +726,9 @@ export function LeadershipDevelopment() {
-

12-Month Executive Development Journey

+

{apiData.program_section.title}

- A comprehensive 3-phase program designed to transform executives into visionary leaders. + {apiData.program_section.description}

@@ -840,118 +809,104 @@ export function LeadershipDevelopment() {
-

Measurable Leadership Outcomes

+

{apiData.impact_section.title}

- Organizations typically see significant improvements in leadership effectiveness, strategic execution, and business performance. + {apiData.impact_section.description}

- {/* Outcomes Grid */} -
- {expectedOutcomes.map((outcome, index) => ( - - -
- -
- {/*
- {outcome.metric} -
*/} -

{outcome.category}

-

{outcome.description}

- {/*

{outcome.category}

*/} -
-
- ))} +
+ {apiData.impact_section.impact_stats.map((stat) => { + const IconComponent = getIconComponent(stat.icon_url); + return ( + + +
+ +
+
+ {stat.value} +
+

{stat.description}

+

{stat.label}

+
+
+ ); + })}
-
+

Additional Strategic Benefits

-
- -

Strategic Thinking

-

Enhanced ability to navigate complex business challenges

-
-
- -

Stakeholder Influence

-

Improved ability to influence and engage key stakeholders

-
-
- -

Organizational Impact

-

Measurable improvements in business results and performance

-
+ {apiData.impact_section.impact_benefits.map((benefit) => { + const IconComponent = getIconComponent(benefit.icon_url); + return ( +
+
+ +
+

{benefit.title}

+

{benefit.description}

+
+ ); + })}
- {/* 7. Client Examples / Testimonials - Hero Section Design */} + {/* 7. Client Examples / Testimonials */} - {/* 8. CTA Section - Hero Section Design */} -
- {/* Background Image */} -
- - - {/* Subtle dark overlay for overall image */} -
- - {/* Gradient overlay for better text readability */} -
-
- - {/* Content Container */} -
- {/* CTA Content Block */} -
- {/* Branded Tag */} - - - {/* Main Headline */} -

- Ready to transform your leadership? - - {" "}Get in touch{" "} - - to drive exceptional strategic outcomes. -

- - {/* CTA Button */} - navigateTo('/contact?topic=leadership-development')} - ariaLabel="Schedule a leadership development consultation" + {/* 8. CTA Section */} + {apiData.cta_section && ( +
+
+ - - {/* Supporting Text */} -

- Connect with our leadership development experts to discuss building visionary leadership capability in your organization. -

+
+
-
-
+ +
+
+ +

+ {apiData.cta_section.text} + + {" "}Get in touch{" "} + + to drive exceptional strategic outcomes. +

+ navigateTo(apiData.cta_section.cta_destination)} + ariaLabel={apiData.cta_section.cta_text} + /> + {apiData.cta_section.description && ( +

+ {apiData.cta_section.description} +

+ )} +
+
+
+ )}
); } \ No newline at end of file diff --git a/src/components/services/LeadershipPipelineDevelopment.tsx b/src/components/services/LeadershipPipelineDevelopment.tsx index 9fdd58d..ebaf2b3 100644 --- a/src/components/services/LeadershipPipelineDevelopment.tsx +++ b/src/components/services/LeadershipPipelineDevelopment.tsx @@ -39,162 +39,270 @@ import { Card, CardContent } from '../ui/card'; import { ImageWithFallback } from '../figma/ImageWithFallback'; import { StandardCTAButton } from '../StandardCTAButton'; import { TestimonialsSection } from '../TestimonialsSection'; +import { useGetServiceListQuery } from '../../redux/services/sercicesApi'; +import { FullScreenLoader } from '../FullScreenLoader'; -const targetAudience = [ - { - title: "CHROs & Talent Leaders", - description: "Senior HR executives responsible for leadership development and succession planning across the organization", - icon: Users, - challenges: ["Succession gaps", "Leadership bench strength", "Talent pipeline visibility", "Development ROI measurement"] - }, - { - title: "Business Leaders & CEOs", - description: "Senior executives who need to ensure leadership continuity and build organizational capability", - icon: Crown, - challenges: ["Leadership continuity risk", "External hiring dependency", "Leadership quality consistency", "Succession readiness"] - }, - { - title: "Learning & Development Teams", - description: "L&D professionals tasked with building comprehensive leadership development ecosystems", - icon: Building, - challenges: ["Program effectiveness", "Multi-level coordination", "Resource optimization", "Impact demonstration"] - } -]; +// Types based on API response +interface ServicePageData { + hero_section: { + id: string; + landing_page_type: string; + background_image_url: string; + background_image_alt_text: string; + headline: string; + subtext: string; + cta_text: string; + cta_destination: string; + }; + overview: { + id: string; + title: string; + description: string; + highlight_text: string; + overview_cards: Array<{ + id: string; + title: string; + description: string; + icon_url: string; + accessible_label: string; + }>; + }; + audience_section: { + id: string; + title: string; + description: string; + audience_cards: Array<{ + id: string; + title: string; + description: string; + icon_url: string; + accessible_label: string; + challenges: string[]; + }>; + }; + use_case_section: { + id: string; + title: string; + description: string; + use_case_cards: Array<{ + id: string; + title: string; + description: string; + icon_url: string; + accessible_label: string; + highlight_text: string; + }>; + }; + approach_section: { + id: string; + title: string; + description: string; + approach_cards: Array<{ + id: string; + title: string; + description: string; + icon_url: string; + accessible_label: string; + bullets: string[]; + }>; + outcomes: Array<{ + id: string; + title: string; + description: string; + icon_url: string; + accessible_label: string; + bullets: string[]; + }>; + }; + stats_section: { + id: string; + title: string; + description: string; + stat_cards: Array<{ + id: string; + value: string; + label: string; + icon_url: string; + accessible_label: string; + }>; + }; + program_section: { + id: string; + title: string; + description: string; + program_phases: Array<{ + phase: { + id: string; + phase_number: number; + title: string; + duration: string; + }; + activities: Array<{ + id: string; + phase_id: string; + text: string; + }>; + outcomes: Array<{ + id: string; + phase_id: string; + text: string; + }>; + }>; + }; + impact_section: { + id: string; + title: string; + description: string; + impact_stats: Array<{ + id: string; + value: string; + description: string; + label: string; + icon_url: string; + accessible_label: string; + }>; + impact_benefits: Array<{ + id: string; + title: string; + description: string; + icon_url: string; + accessible_label: string; + }>; + }; + testimonial_section: Array<{ + id: string; + profile_xid: string; + name: string; + designation: string; + content: string; + video_url: string | null; + display_order: number; + }>; + cta_section: { + id: string; + background_image_url: string; + text: string; + cta_text: string; + cta_destination: string; + description: string; + landing_page_type: string; + service_type: string; + }; +} -const useCases = [ - { - title: "Succession Gap Crisis", - description: "When critical leadership positions lack ready successors or pipeline depth", - icon: Target, - scenario: "More than 40% of key positions have no identified successors" - }, - { - title: "External Hiring Dependency", - description: "When organizations rely heavily on external recruitment for leadership roles", - icon: Building, - scenario: "75%+ of leadership roles filled externally in the past 2 years" - }, - { - title: "Leadership Quality Inconsistency", - description: "When leadership effectiveness varies significantly across levels and functions", - icon: BarChart3, - scenario: "Leadership effectiveness scores below 70% or high variation" - }, - { - title: "Talent Retention Issues", - description: "When high-potential employees leave due to lack of development opportunities", - icon: Users2, - scenario: "High-potential talent turnover above 15% annually" - } -]; +// Map API icons to Lucide icons +const getIconComponent = (iconUrl: string) => { + const iconMap: Record = { + '/icons/pipeline.svg': TrendingUp, + '/icons/succession.svg': Users, + '/icons/hr.svg': Users2, + '/icons/management.svg': Crown, + '/icons/growth.svg': TrendingUp, + '/icons/gap.svg': Target, + '/icons/assessment.svg': BarChart3, + '/icons/development.svg': Brain, + '/icons/outcome.svg': Award, + '/icons/target.svg': Target, + '/icons/engagement.svg': Heart, + '/icons/leader.svg': Crown, + '/icons/performance.svg': TrendingUp, + }; -const programTimeline = [ - { - phase: "Phase 1: Assessment & Pipeline Mapping", - duration: "Months 1-3", - activities: ["Leadership assessment across levels", "Succession gap analysis", "High-potential identification", "Pipeline architecture design"], - deliverables: ["Leadership capability assessment", "Succession readiness report", "Pipeline development strategy", "Individual development plans"] - }, - { - phase: "Phase 2: Multi-Level Development", - duration: "Months 4-12", - activities: ["Tier-specific development programs", "Cross-functional assignments", "Mentoring relationships", "Leadership simulations"], - deliverables: ["Enhanced leadership capabilities", "Succession readiness improvement", "Leadership network expansion", "Real-world application projects"] - }, - { - phase: "Phase 3: Integration & Sustainability", - duration: "Months 13-18", - activities: ["Succession planning integration", "Leadership transitions", "Performance measurement", "Continuous pipeline refresh"], - deliverables: ["Sustainable pipeline system", "Succession-ready candidates", "Leadership transition success", "Pipeline metrics dashboard"] - } -]; - -const expectedOutcomes = [ - { - metric: "85%", - description: "Of participants promoted within 18 months of program completion", - icon: TrendingUp, - category: "Career Advancement" - }, - { - metric: "75%", - description: "Reduction in external leadership hiring dependency", - icon: Building, - category: "Internal Succession" - }, - { - metric: "92%", - description: "Improvement in leadership readiness scores across pipeline", - icon: Target, - category: "Leadership Quality" - }, - { - metric: "3.2x", - description: "Faster time-to-productivity for internally developed leaders", - icon: Zap, - category: "Performance Impact" - } -]; - -// Pipeline Development Testimonials Data -const pipelineTestimonials = [ - { - id: 1, - quote: "Our Leadership Pipeline Development program transformed our succession planning. Within 18 months, we went from having successors for only 30% of key positions to 85% succession readiness. Most importantly, we reduced external leadership hiring by 75%.", - name: "Sarah Williams", - title: "VP Human Resources", - company: "Global Manufacturing Company", - image: "https://images.unsplash.com/photo-1580489944761-15a19d654956?w=600&h=800&fit=crop&crop=face", - hasVideo: true - }, - { - id: 2, - quote: "The systematic approach to pipeline development gave us complete visibility into our leadership depth. We now have ready successors for 92% of critical positions and our internal promotion rate increased by 60%. The ROI has been exceptional.", - name: "Michael Chen", - title: "Chief Operating Officer", - company: "TechForward Solutions", - image: "https://images.unsplash.com/photo-1560472354-b33ff0c44a43?w=600&h=800&fit=crop&crop=face", - hasVideo: true - }, - { - id: 3, - quote: "KLC's pipeline framework revolutionized how we identify and develop future leaders. The comprehensive assessment and development pathways have built unprecedented leadership depth across all business units.", - name: "Jennifer Rodriguez", - title: "Chief People Officer", - company: "Innovation Dynamics Inc", - image: "https://images.unsplash.com/photo-1573496359142-b8d87734a5a2?w=600&h=800&fit=crop&crop=face", - hasVideo: false - }, - { - id: 4, - quote: "The pipeline development process helped us reduce critical role vacancy time by 70% and improved leadership quality scores across all levels. Our board confidence in succession planning has never been higher.", - name: "David Park", - title: "Senior Vice President", - company: "Financial Services Corp", - image: "https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=600&h=800&fit=crop&crop=face", - hasVideo: true - }, - { - id: 5, - quote: "Working with KLC transformed our entire approach to leadership development. We now have a robust pipeline that consistently produces high-quality leaders who drive business results and cultural transformation.", - name: "Lisa Thompson", - title: "Executive Director", - company: "Healthcare Solutions Group", - image: "https://images.unsplash.com/photo-1494790108755-2616b612b647?w=600&h=800&fit=crop&crop=face", - hasVideo: false - } -]; + const IconComponent = iconMap[iconUrl] || Target; + return IconComponent; +}; export function LeadershipPipelineDevelopment() { - const [currentTestimonial, setCurrentTestimonial] = useState(1); - const currentTestimonialData = pipelineTestimonials.find(t => t.id === currentTestimonial) || pipelineTestimonials[0]; - const [expandedUseCase, setExpandedUseCase] = useState(null); const [expandedPhase, setExpandedPhase] = useState(0); + const { data: apiResponse, isLoading, error } = useGetServiceListQuery({ + service_type: 'leadership_pipeline' + }); + + const apiData = apiResponse?.data as ServicePageData | undefined; + useEffect(() => { window.scrollTo(0, 0); }, []); + if (isLoading) { + return ( +
+
+
+

Loading...

+
+
+ ); + } + + if (error || !apiData) { + return ( +
+
+

Error loading content. Please try again later.

+ +
+
+ ); + } + + // Transform data for UI + const targetAudience = apiData.audience_section?.audience_cards.map(card => ({ + title: card.title, + description: card.description, + icon: getIconComponent(card.icon_url), + challenges: card.challenges || [] + })) || []; + + const useCases = apiData.use_case_section?.use_case_cards.map(card => ({ + title: card.title, + description: card.description, + icon: getIconComponent(card.icon_url), + scenario: card.highlight_text + })) || []; + + const programTimeline = apiData.program_section?.program_phases.map(phase => ({ + phase: phase.phase.title, + duration: phase.phase.duration, + activities: phase.activities.map(activity => activity.text), + deliverables: phase.outcomes.map(outcome => outcome.text) + })) || []; + + const expectedOutcomes = apiData.impact_section?.impact_benefits.map(benefit => ({ + metric: apiData.impact_section?.impact_stats[0]?.value || '85%', + description: benefit.description, + icon: getIconComponent(benefit.icon_url), + category: benefit.title + })) || []; + + const testimonials = apiData.testimonial_section?.map(testimonial => { + const designationParts = testimonial.designation.split(','); + const role = designationParts[0]?.trim() || ''; + const company = designationParts[1]?.trim() || ''; + + return { + id: parseInt(testimonial.id) || 0, + name: testimonial.name, + role: role, + company: company, + avatar: `https://ui-avatars.com/api/?name=${encodeURIComponent(testimonial.name)}&background=04045B&color=fff&size=128`, + quote: testimonial.content, + rating: 5, + isVideo: !!testimonial.video_url, + videoThumbnail: testimonial.video_url ? `/images/testimonials/thumbnails/${testimonial.id}.jpg` : undefined, + videoUrl: testimonial.video_url || undefined + }; + }) || []; + + if (isLoading) { + return ( +
+ +
+ ); + } + return (
{/* Hero Section */} @@ -203,7 +311,7 @@ export function LeadershipPipelineDevelopment() {
@@ -212,7 +320,6 @@ export function LeadershipPipelineDevelopment() {
- {/* Back Navigation */}

- Build sustainable leadership pipelines that eliminate succession gaps and reduce external hiring by 75%. + {apiData.hero_section.subtext}

navigateTo('/contact?topic=leadership-pipeline')} - ariaLabel="Book a consultation for leadership pipeline development" + text={apiData.hero_section.cta_text} + onClick={() => navigateTo(apiData.hero_section.cta_destination)} + ariaLabel={apiData.hero_section.cta_text} className="primary-cta-button-blue cta-text-white" />
@@ -253,70 +360,41 @@ export function LeadershipPipelineDevelopment() {
-

Comprehensive Leadership Pipeline System

+

{apiData.overview.title}

- Leadership Pipeline Development is a systematic approach to building sustainable leadership capability across all organizational levels. Our methodology identifies, develops, and transitions high-potential talent through structured programs that create ready-now successors for critical roles. + {apiData.overview.description}

- The Business Problem It Solves: Most organizations face succession gaps where 40%+ of key positions lack identified successors, leading to costly external hiring, leadership disruption, and competitive disadvantage. + The Business Problem It Solves: {apiData.overview.highlight_text}

-
-
-
- + {apiData.overview.overview_cards.map((card, index) => { + const IconComponent = getIconComponent(card.icon_url); + return ( +
+
+
+ +
+

+ {card.title} +

+

+ {card.description} +

+
-

- Multi-Level Pipeline -

-

- Systematic leadership development across all organizational tiers with clear progression pathways -

-
-
- -
-
-
- -
-

- Succession Readiness -

-

- Creates identified, development-ready successors for all critical leadership positions -

-
-
- -
-
-
- -
-

- 75% Hiring Reduction -

-

- Significantly reduces dependency on external leadership hiring through internal capability building -

-
-
+ ); + })}
@@ -328,9 +406,9 @@ export function LeadershipPipelineDevelopment() {
-

Target Audience

+

{apiData.audience_section.title}

- Designed for organizations and leaders responsible for building sustainable leadership capability and succession readiness. + {apiData.audience_section.description}

@@ -373,9 +451,9 @@ export function LeadershipPipelineDevelopment() {
-

When Organizations Need Pipeline Development

+

{apiData.use_case_section.title}

- Ideal for organizations facing leadership gaps and succession challenges. + {apiData.use_case_section.description}

@@ -385,7 +463,6 @@ export function LeadershipPipelineDevelopment() { key={index} className="bg-white rounded-xl border border-gray-200 p-6 hover:border-[#04045B] hover:shadow-lg transition-all duration-300" > - {/* Icon and Title */}
- {/* Trigger Indicator */}
@@ -424,381 +500,245 @@ export function LeadershipPipelineDevelopment() {
-

Systematic Pipeline Development Framework

+

+ {apiData?.approach_section?.title || "Our Approach to Leadership Development"} +

- Our proven methodology combines assessment, development planning, structured learning, and succession integration. + {apiData?.approach_section?.description || "A systematic, research-backed methodology that transforms leadership potential into measurable business impact."}

- {/* Clean Grid Layout */} {/* Flowchart Container with Connecting Lines */}
- {/* Desktop: Horizontal Flowchart */} -
-
- {/* Row 1: Frameworks, Pedagogy, Delivery */} -
- {/* Frameworks */} -
-
- -
-

Frameworks Used

-

- Establish competency models and leadership progression pathways -

-
-
- Competency Models -
-
- Leadership Levels -
-
- Career Pathways -
-
-
+ {/* Only render if approach_cards exist and have items */} + {apiData?.approach_section?.approach_cards && apiData.approach_section.approach_cards.length > 0 && ( + <> + {/* Desktop: Horizontal Flowchart */} +
+
+ {/* Row 1: First 3 approach cards from API */} +
+ {apiData.approach_section.approach_cards.slice(0, 3).map((card, idx) => { + const IconComponent = getIconComponent(card.icon_url); + return ( +
+
+ {IconComponent ? : } +
+

{card.title}

+

{card.description}

+ {card.bullets && card.bullets.length > 0 && ( +
+ {card.bullets.slice(0, 3).map((bullet, bulletIdx) => ( +
+ {bullet} +
+ ))} +
+ )} +
+ ); + })} - {/* Arrow 1→2 */} -
-
- -
- - {/* Pedagogy */} -
-
- + {/* Arrows between first 3 cards */} + {apiData.approach_section.approach_cards.length >= 2 && ( +
+
+ +
+ )} + {apiData.approach_section.approach_cards.length >= 3 && ( +
+
+ +
+ )}
-

Learning Pedagogy

-

- Apply evidence-based learning approaches for maximum impact -

-
-
- Experiential Learning + + {/* Vertical Connector - Center Flow Down */} + {apiData.approach_section.approach_cards.length > 3 && ( +
+
+
+ +
-
- Action Learning + )} + + {/* Row 2: Next 2 approach cards (if available) */} + {apiData.approach_section.approach_cards.length >= 4 && ( +
+ {apiData.approach_section.approach_cards.slice(3, 5).map((card, idx) => { + const IconComponent = getIconComponent(card.icon_url); + const isFirstOfPair = idx === 0; + return ( +
+
+ {IconComponent ? : } +
+

{card.title}

+

{card.description}

+ {card.bullets && card.bullets.length > 0 && ( +
+ {card.bullets.slice(0, 3).map((bullet, bulletIdx) => ( +
+ {bullet} +
+ ))} +
+ )} +
+ ); + })} + + {/* Arrow between the two cards */} + {apiData.approach_section.approach_cards.length >= 5 && ( +
+
+ +
+ )}
-
- Peer Learning + )} + + {/* Final Vertical Connector - Center Flow Down to Outcome */} +
+
+
+
-
- {/* Arrow 2→3 */} -
-
- -
- - {/* Delivery Modes */} -
-
- -
-

Delivery Modes

-

- Flexible options to suit organizational needs and schedules -

-
-
- Workshops -
-
- Online Modules -
-
- Cohort Programs + {/* Row 3: Expected Outcome - Use API outcomes data */} +
+
+
+ {apiData.approach_section.outcomes && apiData.approach_section.outcomes[0] ? (() => { + const OutcomeIcon = getIconComponent(apiData.approach_section.outcomes[0].icon_url); + return OutcomeIcon ? : ; + })() : } +

+ {apiData.approach_section.outcomes?.[0]?.title || "Expected Outcome"} +

+
+

+ {apiData.approach_section.outcomes?.[0]?.description || "A systematic, measurable leadership pipeline that accelerates talent development and succession readiness."} +

+
+ {apiData.approach_section.outcomes?.[0]?.bullets && apiData.approach_section.outcomes[0].bullets.length > 0 ? ( + apiData.approach_section.outcomes[0].bullets.slice(0, 2).map((bullet, idx) => ( +
+ + {bullet} +
+ )) + ) : ( +
+ + Proven ROI on Leadership Investment +
+ )} +
- {/* Vertical Connector - Center Flow Down */} -
-
-
- -
-
+ {/* Tablet & Mobile: Vertical Flowchart */} +
+ {/* Map all approach cards vertically */} + {apiData.approach_section.approach_cards.map((card, idx) => { + const IconComponent = getIconComponent(card.icon_url); + const isEven = idx % 2 === 0; + return ( +
+
+
+ {IconComponent ? : } +
+

{card.title}

+

{card.description}

+ {card.bullets && card.bullets.length > 0 && ( +
+ {card.bullets.map((bullet, bulletIdx) => ( +
+ {bullet} +
+ ))} +
+ )} +
+ {/* Connector Arrow */} + {idx < apiData.approach_section.approach_cards.length - 1 && ( +
+ +
+ )} +
+ ); + })} - {/* Row 2: Assessment, Coaching */} -
- {/* Assessment Integration */} -
-
- -
-

Assessment Integration

-

- Comprehensive evaluation methods to measure progress and potential -

-
-
- 360° Feedback -
-
- Psychometrics -
-
- Simulations -
-
-
- - {/* Arrow 4→5 */} -
-
- -
- - {/* Coaching Integration */} -
-
- -
-

Coaching Integration

-

- Personalized support throughout the development journey -

-
-
- Executive Coaching -
-
- Mentoring -
-
- Peer Coaching -
-
-
-
- - {/* Final Vertical Connector - Center Flow Down to Outcome */} -
-
-
- -
-
- - {/* Row 3: Expected Outcome - Centered */} -
-
+ {/* Expected Outcome - Use API outcomes data */} +
- -

Expected Outcome

+ {apiData.approach_section.outcomes && apiData.approach_section.outcomes[0] ? (() => { + const OutcomeIcon = getIconComponent(apiData.approach_section.outcomes[0].icon_url); + return OutcomeIcon ? : ; + })() : } +

+ {apiData.approach_section.outcomes?.[0]?.title || "Expected Outcome"} +

- A systematic, measurable leadership pipeline that accelerates talent development and succession readiness. + {apiData.approach_section.outcomes?.[0]?.description || "A systematic, measurable leadership pipeline that accelerates talent development and succession readiness."}

-
- - Proven ROI on Leadership Investment +
+ {apiData.approach_section.outcomes?.[0]?.bullets && apiData.approach_section.outcomes[0].bullets.length > 0 ? ( + apiData.approach_section.outcomes[0].bullets.slice(0, 2).map((bullet, idx) => ( +
+ + {bullet} +
+ )) + ) : ( +
+ + Proven ROI on Leadership Investment +
+ )}
-
-
- - {/* Tablet & Mobile: Vertical Flowchart */} -
- {/* Frameworks */} -
-
-
- -
-

Frameworks Used

-

- Establish competency models and leadership progression pathways -

-
-
- Competency Models -
-
- Leadership Levels -
-
- Career Pathways -
-
-
- {/* Connector Arrow */} -
- -
-
- - {/* Pedagogy */} -
-
-
- -
-

Learning Pedagogy

-

- Apply evidence-based learning approaches for maximum impact -

-
-
- Experiential Learning -
-
- Action Learning -
-
- Peer Learning -
-
-
- {/* Connector Arrow */} -
- -
-
- - {/* Delivery Modes */} -
-
-
- -
-

Delivery Modes

-

- Flexible options to suit organizational needs and schedules -

-
-
- Workshops -
-
- Online Modules -
-
- Cohort Programs -
-
-
- {/* Connector Arrow */} -
- -
-
- - {/* Assessment Integration */} -
-
-
- -
-

Assessment Integration

-

- Comprehensive evaluation methods to measure progress and potential -

-
-
- 360° Feedback -
-
- Psychometrics -
-
- Simulations -
-
-
- {/* Connector Arrow */} -
- -
-
- - {/* Coaching Integration */} -
-
-
- -
-

Coaching Integration

-

- Personalized support throughout the development journey -

-
-
- Executive Coaching -
-
- Mentoring -
-
- Peer Coaching -
-
-
- {/* Connector Arrow */} -
- -
-
- - {/* Expected Outcome */} -
-
- -

Expected Outcome

-
-

- A systematic, measurable leadership pipeline that accelerates talent development and succession readiness. -

-
- - Proven ROI on Leadership Investment -
-
-
+ + )}
- {/* Framework Effectiveness */} - {/*
-
-

Framework Effectiveness

-

- Our systematic approach delivers measurable results across key leadership development metrics. -

-
- -
-
-
- -
-
85%
-

Promotion Readiness Acceleration

+ {/* Framework Effectiveness - Stats Section */} + {apiData?.stats_section && apiData.stats_section.stat_cards && apiData.stats_section.stat_cards.length > 0 && ( +
+
+

{apiData.stats_section.title || "Framework Effectiveness"}

+

+ {apiData.stats_section.description || "Measurable results that demonstrate the impact of our leadership development approach."} +

- -
-
- -
-
92%
-

Talent Retention Improvement

-
- -
-
- -
-
78%
-

Succession Planning Effectiveness

+ +
+ {apiData.stats_section.stat_cards.map((stat) => { + const IconComponent = getIconComponent(stat.icon_url); + return ( +
+
+ {IconComponent ? : } +
+
{stat.value || "0"}
+

{stat.label || ""}

+
+ ); + })}
-
*/} + )}
@@ -810,9 +750,9 @@ export function LeadershipPipelineDevelopment() {
-

18-Month Pipeline Development Journey

+

{apiData.program_section.title}

- A comprehensive 3-phase program designed to build sustainable leadership pipelines across organizational levels. + {apiData.program_section.description}

@@ -893,118 +833,104 @@ export function LeadershipPipelineDevelopment() {
-

Measurable Pipeline Outcomes

+

{apiData.impact_section.title}

- Organizations typically see significant improvements in succession readiness, internal promotion rates, and leadership quality. + {apiData.impact_section.description}

- {/* Outcomes Grid */} -
- {expectedOutcomes.map((outcome, index) => ( - - -
- -
- {/*
- {outcome.metric} -
*/} -

{outcome.category}

-

{outcome.description}

- {/*

{outcome.category}

*/} -
-
- ))} +
+ {apiData.impact_section.impact_stats.map((stat) => { + const IconComponent = getIconComponent(stat.icon_url); + return ( + + +
+ +
+
+ {stat.value} +
+

{stat.description}

+

{stat.label}

+
+
+ ); + })}
-
+

Additional Pipeline Benefits

-
- -

Leadership Quality

-

Consistent leadership excellence across all organizational levels

-
-
- -

Talent Retention

-

Higher retention of high-potential employees through development

-
-
- -

Strategic Alignment

-

Leadership development aligned with business strategy and goals

-
+ {apiData.impact_section.impact_benefits.map((benefit) => { + const IconComponent = getIconComponent(benefit.icon_url); + return ( +
+
+ +
+

{benefit.title}

+

{benefit.description}

+
+ ); + })}
- {/* 7. Client Examples / Testimonials - Hero Section Design */} + {/* 7. Client Examples / Testimonials */} - {/* 8. CTA Section - Hero Section Design */} -
- {/* Background Image */} -
- - - {/* Subtle dark overlay for overall image */} -
- - {/* Gradient overlay for better text readability */} -
-
- - {/* Content Container */} -
- {/* CTA Content Block */} -
- {/* Branded Tag */} - - - {/* Main Headline */} -

- Ready to build your leadership pipeline? - - {" "}Get in touch{" "} - - to eliminate succession gaps now. -

- - {/* CTA Button */} - navigateTo('/contact?topic=leadership-pipeline')} - ariaLabel="Schedule a leadership pipeline consultation" + {/* 8. CTA Section */} + {apiData.cta_section && ( +
+
+ - - {/* Supporting Text */} -

- Connect with our pipeline development experts to discuss building sustainable leadership capability across your organization. -

+
+
-
-
+ +
+
+ +

+ {apiData.cta_section.text} + + {" "}Get in touch{" "} + + to eliminate succession gaps now. +

+ navigateTo(apiData.cta_section.cta_destination)} + ariaLabel={apiData.cta_section.cta_text} + /> + {apiData.cta_section.description && ( +

+ {apiData.cta_section.description} +

+ )} +
+
+
+ )}
); } \ No newline at end of file diff --git a/src/components/services/ManagementDevelopment.tsx b/src/components/services/ManagementDevelopment.tsx index a2a2a2f..c5bb963 100644 --- a/src/components/services/ManagementDevelopment.tsx +++ b/src/components/services/ManagementDevelopment.tsx @@ -1,6 +1,5 @@ import React, { useEffect, useState } from 'react'; import { Button } from '../ui/button'; -import { Badge } from '../ui/badge'; import { Card, CardContent } from '../ui/card'; import { ImageWithFallback } from '../figma/ImageWithFallback'; import { navigateTo } from '../Router'; @@ -11,137 +10,285 @@ import { ArrowRight, CheckCircle, Settings, - Calendar, - Download, - Network, Users, Target, Brain, - Eye, TrendingUp, BarChart3, Award, - Lightbulb, - Shield, ChevronDown, ChevronUp, ArrowLeft, Star, - Zap, - Globe, Clock, - BookOpen, MessageCircle, - Building, UserCheck, Heart } from 'lucide-react'; import { TestimonialsSection } from '../TestimonialsSection'; +import { useGetServiceListQuery } from '../../redux/services/sercicesApi'; +import { FullScreenLoader } from '../FullScreenLoader'; -const targetAudience = [ - { - title: "HR Leaders & L&D Professionals", - description: "Human resource leaders and learning & development professionals responsible for developing management capability", - icon: Users, - challenges: ["Manager effectiveness gaps", "Leadership transition failures", "Performance management issues", "Team engagement problems"] - }, - { - title: "Senior Leaders & Directors", - description: "Senior executives overseeing multiple management levels and seeking to build organizational capability", - icon: Target, - challenges: ["Management quality consistency", "Leadership pipeline gaps", "Organizational performance", "Talent retention issues"] - }, - { - title: "New & Mid-Level Managers", - description: "First-time managers and experienced supervisors seeking to enhance their management effectiveness", - icon: UserCheck, - challenges: ["Leadership transition challenges", "Team management skills", "Performance conversations", "Strategic thinking development"] - } -]; +// Types based on API response +interface ServicePageData { + hero_section: { + id: string; + landing_page_type: string; + background_image_url: string; + background_image_alt_text: string; + headline: string; + subtext: string; + cta_text: string; + cta_destination: string; + }; + overview: { + id: string; + title: string; + description: string; + highlight_text: string; + overview_cards: Array<{ + id: string; + title: string; + description: string; + icon_url: string; + accessible_label: string; + }>; + }; + audience_section: { + id: string; + title: string; + description: string; + audience_cards: Array<{ + id: string; + title: string; + description: string; + icon_url: string; + accessible_label: string; + challenges: string[]; + }>; + }; + use_case_section: { + id: string; + title: string; + description: string; + use_case_cards: Array<{ + id: string; + title: string; + description: string; + icon_url: string; + accessible_label: string; + highlight_text: string; + }>; + }; + approach_section: { + id: string; + title: string; + description: string; + approach_cards: Array<{ + id: string; + title: string; + description: string; + icon_url: string; + accessible_label: string; + bullets: string[]; + }>; + outcomes: Array<{ + id: string; + title: string; + description: string; + icon_url: string; + accessible_label: string; + bullets: string[]; + }>; + }; + stats_section: { + id: string; + title: string; + description: string; + stat_cards: Array<{ + id: string; + value: string; + label: string; + icon_url: string; + accessible_label: string; + }>; + }; + program_section: { + id: string; + title: string; + description: string; + program_phases: Array<{ + phase: { + id: string; + phase_number: number; + title: string; + duration: string; + }; + activities: Array<{ + id: string; + phase_id: string; + text: string; + }>; + outcomes: Array<{ + id: string; + phase_id: string; + text: string; + }>; + }>; + }; + impact_section: { + id: string; + title: string; + description: string; + impact_stats: Array<{ + id: string; + value: string; + description: string; + label: string; + icon_url: string; + accessible_label: string; + }>; + impact_benefits: Array<{ + id: string; + title: string; + description: string; + icon_url: string; + accessible_label: string; + }>; + }; + testimonial_section: Array<{ + id: string; + profile_xid: string; + name: string; + designation: string; + content: string; + video_url: string | null; + display_order: number; + }>; + cta_section: { + id: string; + background_image_url: string; + text: string; + cta_text: string; + cta_destination: string; + description: string; + landing_page_type: string; + service_type: string; + }; +} -const useCases = [ - { - title: "Manager Effectiveness Gaps", - description: "When management performance is inconsistent or below organizational standards", - icon: Target, - scenario: "Manager effectiveness scores below 70% or high team turnover" - }, - { - title: "Leadership Transition Failures", - description: "When new managers struggle to transition from individual contributor to leader", - icon: Users, - scenario: "High failure rates in first-time manager transitions" - }, - { - title: "Team Performance Issues", - description: "When teams underperform due to poor management practices and leadership", - icon: TrendingUp, - scenario: "Team performance metrics consistently below targets" - }, - { - title: "Cultural Alignment Needs", - description: "When managers need to align with organizational culture and values", - icon: Heart, - scenario: "Culture scores low or inconsistent across management levels" - } -]; +// Map API icons to Lucide icons +const getIconComponent = (iconUrl: string) => { + const iconMap: Record = { + '/icons/pipeline.svg': TrendingUp, + '/icons/succession.svg': Users, + '/icons/hr.svg': Users, + '/icons/management.svg': Target, + '/icons/growth.svg': TrendingUp, + '/icons/gap.svg': Target, + '/icons/assessment.svg': BarChart3, + '/icons/development.svg': Brain, + '/icons/outcome.svg': Award, + '/icons/target.svg': Target, + '/icons/engagement.svg': Heart, + '/icons/leader.svg': Award, + '/icons/performance.svg': TrendingUp, + '/icons/people.svg': Users, + '/icons/team.svg': Users, + '/icons/coaching.svg': MessageCircle, + }; -const programTimeline = [ - { - phase: "Phase 1: Foundation Building", - duration: "Months 1-3", - activities: ["Management fundamentals training", "Leadership style assessment", "Team building workshops", "Goal setting and planning"], - deliverables: ["Management capability baseline", "Individual development plans", "Team assessment results", "90-day action plans"] - }, - { - phase: "Phase 2: Skill Development", - duration: "Months 4-6", - activities: ["Performance management training", "Communication skills development", "Conflict resolution workshops", "Coaching skills building"], - deliverables: ["Enhanced management skills", "Performance review proficiency", "Team communication improvement", "Coaching capability"] - }, - { - phase: "Phase 3: Application & Mastery", - duration: "Months 7-9", - activities: ["Real-world application projects", "Mentoring and coaching", "Advanced leadership topics", "Continuous improvement"], - deliverables: ["Measurable team improvements", "Leadership project results", "Peer mentoring capability", "Sustained behavior change"] - } -]; - -const expectedOutcomes = [ - { - metric: "89%", - description: "Of managers show improved team performance within 6 months", - icon: TrendingUp, - category: "Team Performance" - }, - { - metric: "76%", - description: "Reduction in management-related team turnover", - icon: Users, - category: "Retention" - }, - { - metric: "92%", - description: "Manager confidence improvement in leadership conversations", - icon: MessageCircle, - category: "Communication" - }, - { - metric: "84%", - description: "Of participants promoted within 18 months", - icon: Star, - category: "Career Growth" - } -]; + return iconMap[iconUrl] || Target; +}; export function ManagementDevelopment() { - const [expandedUseCase, setExpandedUseCase] = useState(null); const [expandedPhase, setExpandedPhase] = useState(0); + const { data: apiResponse, isLoading, error } = useGetServiceListQuery({ + service_type: 'management_development' + }); + + const apiData = apiResponse?.data as ServicePageData | undefined; + useEffect(() => { window.scrollTo(0, 0); }, []); + // Loading state + if (isLoading) { + return ( +
+ +
+ ); + } + + // Error state + if (error) { + console.error('API Error:', error); + return ( +
+
+

Error loading content. Please try again later.

+ +
+
+ ); + } + + // Check if apiData exists and has required properties + if (!apiData || !apiData.hero_section) { + return ( +
+
+

No data available for this service.

+ +
+
+ ); + } + + // Transform data for UI with safe fallbacks + const targetAudience = apiData.audience_section?.audience_cards?.map(card => ({ + title: card.title || '', + description: card.description || '', + icon: getIconComponent(card.icon_url), + challenges: card.challenges || [] + })) || []; + + const useCases = apiData.use_case_section?.use_case_cards?.map(card => ({ + title: card.title || '', + description: card.description || '', + icon: getIconComponent(card.icon_url), + scenario: card.highlight_text || '' + })) || []; + + const programTimeline = apiData.program_section?.program_phases?.map(phase => ({ + phase: phase.phase?.title || '', + duration: phase.phase?.duration || '', + activities: phase.activities?.map(activity => activity.text) || [], + deliverables: phase.outcomes?.map(outcome => outcome.text) || [] + })) || []; + + const testimonials = apiData.testimonial_section?.map(testimonial => { + const designationParts = testimonial.designation?.split(',') || []; + const role = designationParts[0]?.trim() || ''; + const company = designationParts[1]?.trim() || ''; + + return { + id: parseInt(testimonial.id) || 0, + name: testimonial.name || '', + role: role, + company: company, + avatar: `https://ui-avatars.com/api/?name=${encodeURIComponent(testimonial.name || 'User')}&background=04045B&color=fff&size=128`, + quote: testimonial.content || '', + rating: 5, + isVideo: !!testimonial.video_url, + videoThumbnail: testimonial.video_url ? `/images/testimonials/thumbnails/${testimonial.id}.jpg` : undefined, + videoUrl: testimonial.video_url || undefined + }; + }) || []; + return (
{/* Hero Section */} @@ -150,7 +297,7 @@ export function ManagementDevelopment() {
@@ -159,7 +306,6 @@ export function ManagementDevelopment() {
- {/* Back Navigation */}

- Build exceptional managers who drive 89% better team performance and reduce turnover by 76%. + {apiData.hero_section.subtext || 'Build exceptional managers who drive team performance.'}

navigateTo('/contact?topic=management-development')} - ariaLabel="Talk to us about management development" + text={apiData.hero_section.cta_text || 'Talk to Us'} + onClick={() => navigateTo(apiData.hero_section.cta_destination || '/contact')} + ariaLabel={apiData.hero_section.cta_text || 'Talk to Us'} className="primary-cta-button-blue cta-text-white" />
@@ -200,70 +346,41 @@ export function ManagementDevelopment() {
-

Comprehensive Management Development

+

{apiData.overview?.title || 'Comprehensive Management Development'}

- Management Development is a structured program designed to build exceptional people leaders who can effectively manage teams, drive performance, and create positive work environments. Our approach combines practical management skills with leadership development to create managers who inspire and deliver results. + {apiData.overview?.description || 'A structured program designed to build exceptional people leaders who can effectively manage teams, drive performance, and create positive work environments.'}

- The Business Problem It Solves: Many organizations promote high-performing individual contributors to management roles without proper training, leading to poor team performance, high turnover, and frustrated employees. Our program ensures managers have the skills, confidence, and tools to succeed in their leadership roles. + The Business Problem It Solves: {apiData.overview?.highlight_text || 'Many organizations promote high-performing individual contributors to management roles without proper training, leading to poor team performance and high turnover.'}

-
-
-
- + {apiData.overview?.overview_cards?.map((card, index) => { + const IconComponent = getIconComponent(card.icon_url); + return ( +
+
+
+ +
+

+ {card.title} +

+

+ {card.description} +

+
-

- People Leadership -

-

- Essential skills for managing and developing teams effectively with modern leadership principles -

-
-
- -
-
-
- -
-

- Performance Focus -

-

- Tools and techniques to drive team performance and achieve measurable business results -

-
-
- -
-
-
- -
-

- 89% Success Rate -

-

- Proven track record with 89% of managers showing improved team performance within 6 months -

-
-
+ ); + })}
@@ -275,9 +392,9 @@ export function ManagementDevelopment() {
-

Target Audience

+

{apiData.audience_section?.title || 'Target Audience'}

- Designed for organizations seeking to build management capability and individuals transitioning into leadership roles. + {apiData.audience_section?.description || 'Designed for organizations seeking to build management capability and individuals transitioning into leadership roles.'}

@@ -320,9 +437,9 @@ export function ManagementDevelopment() {
-

When Organizations Need Management Development

+

{apiData.use_case_section?.title || 'When Organizations Need Management Development'}

- Ideal for organizations facing management effectiveness gaps and team performance challenges. + {apiData.use_case_section?.description || 'Ideal for organizations facing management effectiveness gaps and team performance challenges.'}

@@ -332,7 +449,6 @@ export function ManagementDevelopment() { key={index} className="bg-white rounded-xl border border-gray-200 p-6 hover:border-[#04045B] hover:shadow-lg transition-all duration-300" > - {/* Icon and Title */}
- {/* Trigger Indicator */}
@@ -364,387 +479,252 @@ export function ManagementDevelopment() {
- {/* 4. Our Approach */} + {/* 4. Our Approach - With Flowchart Design */}
-

Practical Management Development Framework

+

+ {apiData?.approach_section?.title || "Our Approach to Leadership Development"} +

- Our proven methodology combines management fundamentals, practical application, and ongoing support for sustainable results. + {apiData?.approach_section?.description || "A systematic, research-backed methodology that transforms leadership potential into measurable business impact."}

{/* Flowchart Container with Connecting Lines */}
- {/* Desktop: Horizontal Flowchart */} -
-
- {/* Row 1: Frameworks, Pedagogy, Delivery */} -
- {/* Frameworks */} -
-
- -
-

Management Frameworks

-

- Core management models and team leadership principles -

-
-
- People Management -
-
- Performance Systems -
-
- Team Development -
-
-
+ {/* Only render if approach_cards exist and have items */} + {apiData?.approach_section?.approach_cards && apiData.approach_section.approach_cards.length > 0 && ( + <> + {/* Desktop: Horizontal Flowchart */} +
+
+ {/* Row 1: First 3 approach cards from API */} +
+ {apiData.approach_section.approach_cards.slice(0, 3).map((card, idx) => { + const IconComponent = getIconComponent(card.icon_url); + return ( +
+
+ {IconComponent ? : } +
+

{card.title}

+

{card.description}

+ {card.bullets && card.bullets.length > 0 && ( +
+ {card.bullets.slice(0, 3).map((bullet, bulletIdx) => ( +
+ {bullet} +
+ ))} +
+ )} +
+ ); + })} - {/* Arrow 1→2 */} -
-
- -
- - {/* Pedagogy */} -
-
- + {/* Arrows between first 3 cards */} + {apiData.approach_section.approach_cards.length >= 2 && ( +
+
+ +
+ )} + {apiData.approach_section.approach_cards.length >= 3 && ( +
+
+ +
+ )}
-

Learning Pedagogy

-

- Practical learning through application and peer exchange -

-
-
- Experiential Learning + + {/* Vertical Connector - Center Flow Down */} + {apiData.approach_section.approach_cards.length > 3 && ( +
+
+
+ +
-
- Action Learning + )} + + {/* Row 2: Next 2 approach cards (if available) */} + {apiData.approach_section.approach_cards.length >= 4 && ( +
+ {apiData.approach_section.approach_cards.slice(3, 5).map((card, idx) => { + const IconComponent = getIconComponent(card.icon_url); + const isFirstOfPair = idx === 0; + return ( +
+
+ {IconComponent ? : } +
+

{card.title}

+

{card.description}

+ {card.bullets && card.bullets.length > 0 && ( +
+ {card.bullets.slice(0, 3).map((bullet, bulletIdx) => ( +
+ {bullet} +
+ ))} +
+ )} +
+ ); + })} + + {/* Arrow between the two cards */} + {apiData.approach_section.approach_cards.length >= 5 && ( +
+
+ +
+ )}
-
- Peer Learning + )} + + {/* Final Vertical Connector - Center Flow Down to Outcome */} +
+
+
+
-
- {/* Arrow 2→3 */} -
-
- -
- - {/* Delivery Modes */} -
-
- -
-

Delivery Modes

-

- Flexible formats for manager development needs -

-
-
- Interactive Workshops -
-
- Peer Cohorts -
-
- Action Projects + {/* Row 3: Expected Outcome - Use API outcomes data */} +
+
+
+ {apiData.approach_section.outcomes && apiData.approach_section.outcomes[0] ? (() => { + const OutcomeIcon = getIconComponent(apiData.approach_section.outcomes[0].icon_url); + return OutcomeIcon ? : ; + })() : } +

+ {apiData.approach_section.outcomes?.[0]?.title || "Expected Outcome"} +

+
+

+ {apiData.approach_section.outcomes?.[0]?.description || "A systematic, measurable leadership pipeline that accelerates talent development and succession readiness."} +

+
+ {apiData.approach_section.outcomes?.[0]?.bullets && apiData.approach_section.outcomes[0].bullets.length > 0 ? ( + apiData.approach_section.outcomes[0].bullets.slice(0, 2).map((bullet, idx) => ( +
+ + {bullet} +
+ )) + ) : ( +
+ + Proven ROI on Leadership Investment +
+ )} +
- {/* Vertical Connector - Center Flow Down */} -
-
-
- -
-
+ {/* Tablet & Mobile: Vertical Flowchart */} +
+ {/* Map all approach cards vertically */} + {apiData.approach_section.approach_cards.map((card, idx) => { + const IconComponent = getIconComponent(card.icon_url); + const isEven = idx % 2 === 0; + return ( +
+
+
+ {IconComponent ? : } +
+

{card.title}

+

{card.description}

+ {card.bullets && card.bullets.length > 0 && ( +
+ {card.bullets.map((bullet, bulletIdx) => ( +
+ {bullet} +
+ ))} +
+ )} +
+ {/* Connector Arrow */} + {idx < apiData.approach_section.approach_cards.length - 1 && ( +
+ +
+ )} +
+ ); + })} - {/* Row 2: Assessment, Coaching */} -
- {/* Assessment Integration */} -
-
- -
-

Assessment Integration

-

- Comprehensive evaluation to track manager effectiveness -

-
-
- 360° Feedback -
-
- Performance Metrics -
-
- Team Engagement -
-
-
- - {/* Arrow 4→5 */} -
-
- -
- - {/* Coaching Integration */} -
-
- -
-

Coaching Integration

-

- Personalized coaching support for manager challenges -

-
-
- Individual Coaching -
-
- Group Coaching -
-
- Peer Coaching -
-
-
-
- - {/* Final Vertical Connector - Center Flow Down to Outcome */} -
-
-
- -
-
- - {/* Row 3: Expected Outcome - Centered */} -
-
+ {/* Expected Outcome - Use API outcomes data */} +
- -

Expected Outcome

+ {apiData.approach_section.outcomes && apiData.approach_section.outcomes[0] ? (() => { + const OutcomeIcon = getIconComponent(apiData.approach_section.outcomes[0].icon_url); + return OutcomeIcon ? : ; + })() : } +

+ {apiData.approach_section.outcomes?.[0]?.title || "Expected Outcome"} +

- Effective people managers who build high-performing teams, drive business results, and create positive work environments. + {apiData.approach_section.outcomes?.[0]?.description || "A systematic, measurable leadership pipeline that accelerates talent development and succession readiness."}

-
- - Enhanced Management Effectiveness +
+ {apiData.approach_section.outcomes?.[0]?.bullets && apiData.approach_section.outcomes[0].bullets.length > 0 ? ( + apiData.approach_section.outcomes[0].bullets.slice(0, 2).map((bullet, idx) => ( +
+ + {bullet} +
+ )) + ) : ( +
+ + Proven ROI on Leadership Investment +
+ )}
-
-
- - {/* Tablet & Mobile: Vertical Flowchart */} -
- {/* Frameworks */} -
-
-
- -
-

Management Frameworks

-

- Core management models and team leadership principles -

-
-
- People Management -
-
- Performance Systems -
-
- Team Development -
-
-
- {/* Connector Arrow */} -
- -
-
- - {/* Pedagogy */} -
-
-
- -
-

Learning Pedagogy

-

- Practical learning through application and peer exchange -

-
-
- Experiential Learning -
-
- Action Learning -
-
- Peer Learning -
-
-
- {/* Connector Arrow */} -
- -
-
- - {/* Delivery Modes */} -
-
-
- -
-

Delivery Modes

-

- Flexible formats for manager development needs -

-
-
- Interactive Workshops -
-
- Peer Cohorts -
-
- Action Projects -
-
-
- {/* Connector Arrow */} -
- -
-
- - {/* Assessment Integration */} -
-
-
- -
-

Assessment Integration

-

- Comprehensive evaluation to track manager effectiveness -

-
-
- 360° Feedback -
-
- Performance Metrics -
-
- Team Engagement -
-
-
- {/* Connector Arrow */} -
- -
-
- - {/* Coaching Integration */} -
-
-
- -
-

Coaching Integration

-

- Personalized coaching support for manager challenges -

-
-
- Individual Coaching -
-
- Group Coaching -
-
- Peer Coaching -
-
-
- {/* Connector Arrow */} -
- -
-
- - {/* Expected Outcome */} -
-
- -

Expected Outcome

-
-

- Effective people managers who build high-performing teams, drive business results, and create positive work environments. -

-
- - Enhanced Management Effectiveness -
-
-
+ + )}
- {/* Framework Effectiveness */} - {/*
-
-

Framework Effectiveness

-

- Our systematic approach delivers measurable results across key management development metrics. -

-
- -
-
-
- -
-
89%
-

Manager Effectiveness Increase

+ {/* Framework Effectiveness - Stats Section */} + {apiData?.stats_section && apiData.stats_section.stat_cards && apiData.stats_section.stat_cards.length > 0 && ( +
+
+

{apiData.stats_section.title || "Framework Effectiveness"}

+

+ {apiData.stats_section.description || "Measurable results that demonstrate the impact of our leadership development approach."} +

-
-
- -
-
85%
-

Team Performance Improvement

-
- -
-
- -
-
78%
-

Employee Engagement Growth

+
+ {apiData.stats_section.stat_cards.map((stat) => { + const IconComponent = getIconComponent(stat.icon_url); + return ( +
+
+ {IconComponent ? : } +
+
{stat.value || "0"}
+

{stat.label || ""}

+
+ ); + })}
-
*/} + )}
@@ -756,9 +736,9 @@ export function ManagementDevelopment() {
-

9-Month Management Development Journey

+

{apiData.program_section?.title || 'Management Development Journey'}

- A comprehensive 3-phase program designed to build exceptional management capability. + {apiData.program_section?.description || 'A comprehensive program designed to build exceptional management capability.'}

@@ -839,117 +819,104 @@ export function ManagementDevelopment() {
-

Measurable Management Outcomes

+

{apiData.impact_section?.title || 'Measurable Management Outcomes'}

- Organizations typically see significant improvements in team performance, employee engagement, and management effectiveness. + {apiData.impact_section?.description || 'Organizations typically see significant improvements in team performance, employee engagement, and management effectiveness.'}

- {/* Outcomes Grid */} -
- {expectedOutcomes.map((outcome, index) => ( - - -
- -
- {/*
- {outcome.metric} -
*/} -

{outcome.category}

-

{outcome.description}

-
-
- ))} +
+ {apiData.impact_section?.impact_stats?.map((stat) => { + const IconComponent = getIconComponent(stat.icon_url); + return ( + + +
+ +
+
+ {stat.value} +
+

{stat.description}

+

{stat.label}

+
+
+ ); + })}
-
+

Additional Management Benefits

-
- -

Team Engagement

-

Higher employee engagement and job satisfaction scores

-
-
- -

Goal Achievement

-

Improved team goal achievement and performance metrics

-
-
- -

Manager Confidence

-

Increased confidence in management conversations and decisions

-
+ {apiData.impact_section?.impact_benefits?.map((benefit) => { + const IconComponent = getIconComponent(benefit.icon_url); + return ( +
+
+ +
+

{benefit.title}

+

{benefit.description}

+
+ ); + })}
- {/* 7. Client Examples / Testimonials - Hero Section Design */} + {/* 7. Client Examples / Testimonials */} - {/* 8. CTA Section - Hero Section Design */} -
- {/* Background Image */} -
- - - {/* Subtle dark overlay for overall image */} -
- - {/* Gradient overlay for better text readability */} -
-
- - {/* Content Container */} -
- {/* CTA Content Block */} -
- {/* Branded Tag */} - - - {/* Main Headline */} -

- Ready to build exceptional managers? - - {" "}Get in touch{" "} - - to drive team performance now. -

- - {/* CTA Button */} - navigateTo('/contact?topic=management-development')} - ariaLabel="Schedule a management development consultation" + {/* 8. CTA Section */} + {apiData.cta_section && ( +
+
+ - - {/* Supporting Text */} -

- Connect with our management development experts to discuss building exceptional managers who drive team engagement and results. -

+
+
-
-
+ +
+
+ +

+ {apiData.cta_section.text} + + {" "}Get in touch{" "} + + to drive team performance now. +

+ navigateTo(apiData.cta_section.cta_destination)} + ariaLabel={apiData.cta_section.cta_text} + /> + {apiData.cta_section.description && ( +

+ {apiData.cta_section.description} +

+ )} +
+
+
+ )}
); } \ No newline at end of file diff --git a/src/components/ui/dialog.tsx b/src/components/ui/dialog.tsx index 903d7cc..220677e 100644 --- a/src/components/ui/dialog.tsx +++ b/src/components/ui/dialog.tsx @@ -1,8 +1,8 @@ "use client"; import * as React from "react"; -import * as DialogPrimitive from "@radix-ui/react-dialog@1.1.6"; -import { XIcon } from "lucide-react@0.487.0"; +import * as DialogPrimitive from "@radix-ui/react-dialog"; +import { XIcon } from "lucide-react"; import { cn } from "./utils"; diff --git a/src/pages/HomePage.tsx b/src/pages/HomePage.tsx index 7385c7d..2ac17f1 100644 --- a/src/pages/HomePage.tsx +++ b/src/pages/HomePage.tsx @@ -12,6 +12,7 @@ import { PrimaryCTAButton } from "../components/PrimaryCTAButton"; import { BrandedTag } from "../components/about/BrandedTag"; import { useNavigate } from "react-router-dom"; import { useGetHomepageQuery } from "../redux/services/homepageApi"; +import { FullScreenLoader } from "../components/FullScreenLoader"; const HomePage: React.FC = () => { const navigate = useNavigate(); @@ -24,6 +25,27 @@ const HomePage: React.FC = () => { const stats = data?.stats_sections ?? []; const highlightCards = data?.highlight_cards ?? []; const ctaBands = data?.cta_bands ?? []; + const ctaSection = data?.cta_section; + + // Transform testimonial section data to match Testimonial interface + const testimonialData = data?.testimonial_section?.map((item: any) => ({ + id: item.id, + name: item.name, + role: item.designation, + quote: item.content, + videoUrl: item.video_url, + isVideo: !!item.video_url, + rating: 5, // Default rating, can be updated from API if available + avatar: item.profile_xid ? `https://example.com/avatars/${item.profile_xid}.jpg` : undefined, + })) || []; + + if (isLoading) { + return ( +
+ +
+ ); + } return ( <> @@ -92,9 +114,15 @@ const HomePage: React.FC = () => {
- + {/* Pass testimonial data to the TestimonialsSection */} + - + ); }; diff --git a/src/redux/hooks/useDebounce.ts b/src/redux/hooks/useDebounce.ts new file mode 100644 index 0000000..2605ca6 --- /dev/null +++ b/src/redux/hooks/useDebounce.ts @@ -0,0 +1,17 @@ +import { useState, useEffect } from 'react'; + +export function useDebounce(value: T, delay: number): T { + const [debouncedValue, setDebouncedValue] = useState(value); + + useEffect(() => { + const handler = setTimeout(() => { + setDebouncedValue(value); + }, delay); + + return () => { + clearTimeout(handler); + }; + }, [value, delay]); + + return debouncedValue; +} \ No newline at end of file diff --git a/src/redux/services/aboutUsApi.ts b/src/redux/services/aboutUsApi.ts index a0c195f..93a0b18 100644 --- a/src/redux/services/aboutUsApi.ts +++ b/src/redux/services/aboutUsApi.ts @@ -20,6 +20,17 @@ export interface HowWeWorkItem { display_order: number; } +export interface Testimonial { + id: string; + profile_xid: string; + name: string; + designation: string; + content: string; + video_url: string; + display_order: number; + testimonial_page_type: string; +} + export interface StatItem { id: string; number: number; @@ -36,6 +47,16 @@ export interface TeamMember { alt_text: string; bio: string; } +export interface CtaData { + id: string; + background_image_url: string; + text: string; + cta_text: string; + cta_destination: string; + description: string; + landing_page_type: string; + service_type: string | null; +} export interface AboutUsData { hero_section: HeroSection; @@ -43,11 +64,37 @@ export interface AboutUsData { how_we_work_title: string; who_we_are_title: string; our_team_title: string; + our_team_description: string; how_we_work: HowWeWorkItem[]; stat_section: StatItem[]; our_team: TeamMember[]; + methodology: Methodology; + philosophy: Philosophy; + testimonials: Testimonial[]; + cta_section: CtaData; } +export interface Methodology { + title: string; + subtitle: string; + phases: Phase[]; +} +export interface Phase { + id?: string; + phase_number: number; + phase_label: string; + title: string; + description: string; + bullet_title: string; + bullets: string[]; + display_order: number; +} + +export interface Philosophy { + title: string; + description: string; + points: string[]; +} export interface AboutUsResponse { success: boolean; status: number; diff --git a/src/redux/services/courseApi.ts b/src/redux/services/courseApi.ts new file mode 100644 index 0000000..490fac0 --- /dev/null +++ b/src/redux/services/courseApi.ts @@ -0,0 +1,371 @@ +import { createApi } from "@reduxjs/toolkit/query/react"; +import baseQueryWithReauth from "./baseQuery"; + +/* ================= TYPES ================= */ + +export type CourseStatus = + | "publish" + | "unpublish" + | "archive" + | "processing" + | "in_draft"; + +export interface GetCoursesParams { + limit?: number; + offset?: number; + status?: CourseStatus; + search_query?: string; + course_category?: string[]; + price_range?: string; + duration_range?: string; + min_rating?: number; + sort_by?: string; +} + +export interface Course { + id: string; + course_name: string; + course_desc: string; + thumbnail_img: string; + course_category_xid: string; + course_category_name: string; + best_value: number; + avg_rating: number; + total_reviews: number; + retail_type: string; + price: number; + is_certificate_available: boolean; + course_status: CourseStatus; + updated_at: string; + total_duration: number; + no_of_modules: number; +} + +export interface PaginationInfo { + total_count: number; + limit: number; + offset: number; + applied_filters: { + status: string | null; + course_category_xid: string[] | null; + content_types_xid: string[] | null; + search_query: string | null; + price_range: string | null; + duration_range: string | null; + min_rating: number | null; + sort_by: string | null; + }; +} + +export interface CourseListResponse { + success: boolean; + status: number; + message: string; + data: { + pagination_info: PaginationInfo; + items: Course[]; + }; +} + +export interface CourseReview { + id: string; + rating: number; + comment: string; + video_url: string | null; + reviewer_name: string; + profile_image: string | null; + bio: string | null; + created_at: string; +} + +export interface CourseFaq { + id: string; + question: string; + answer: string; +} + +export interface CourseTargetAudience { + id: string; + course_xid: string; + course_icon_xid: string; + title: string; + description: string; + display_order: number; +} + +export interface CourseLearningOutcome { + id: string; + course_xid: string; + title: string; + description: string; + display_order: number; +} + +export interface CourseLearningStructure { + id: string; + course_xid: string; + title: string; + description: string; + display_order: number; +} + +export interface CourseFacultyCredential { + id: string; + course_xid: string; + course_faculty_xid: string; + credential_name: string; + display_order: number; +} + +export interface CourseFaculty { + id: string; + course_xid: string; + faculty_name: string; + faculty_title: string; + faculty_organization_name: string; + faculty_biography: string; + display_order: number; + expertises: string[] | null; + credentials: CourseFacultyCredential[]; +} + +export interface CourseLessonResource { + id: string; + course_xid: string; + module_xid: string; + lesson_xid: string; + content_xid: string; + content_type_xid: string; + content_title: string; + total_duration: number | null; + content_type_name: string; + is_active: boolean; +} + +export interface CourseLesson { + id: string; + course_xid: string; + module_xid: string; + lesson_title: string; + lesson_description: string; + is_lock_lesson: boolean; + display_order: number; + lesson_resources: CourseLessonResource[]; +} + +export interface CourseModule { + id: string; + course_xid: string; + module_name: string; + display_order: number; + lessons: CourseLesson[]; +} + +export interface CourseResource { + id: string; + course_xid: string; + content_xid: string; + content_type_xid: string; + display_order: number | null; +} + +export interface CourseCertificateTemplate { + id: string; + template_name: string; + template_code: string; + display_order: number; + is_active: boolean; +} + +export interface CourseCertificate { + id: string; + course_xid: string; + certificate_template_xid: string; + company_logo_url: string | null; + institution_name: string; + program_title: string; + signatory_name: string; + signatory_title: string; + digital_signature_url: string | null; + minimum_pass_percentage: number; + complete_all_lesson_required: boolean; + certificate_template: CourseCertificateTemplate; +} + +export interface RecommendedCourse { + id: string; + course_name: string; + course_desc: string; + thumbnail_img: string; + price: string; + best_value: number; + duration: number; + recommended_course_reviews: { + id: string; + rating: number; + comment: string; + reviewer_name: string; + }[]; +} + +export interface CourseDetail { + id: string; + course_name: string; + course_desc: string; + thumbnail_img: string; + course_category_xid: string; + duration: number; + retail_type: string; + price: string | number; + best_value: number; + target_audience_desc: string | null; + learning_outcomes_desc: string | null; + learning_structure_desc: string | null; + our_methodology_desc: string | null; + is_certificate_available: boolean; + course_status: CourseStatus; + benefit_section: string | null; + learning_section: string | null; + structure_section: string | null; + approach_section: string | null; + faculty_section: string | null; + avg_rating: number; + total_reviews: number; + reviews: CourseReview[]; + course_faqs: CourseFaq[]; + total_modules: number; + total_lessons: number; + formatted_duration: string; + course_category_name: string; + course_language_xids: string[]; + course_target_audiences: CourseTargetAudience[]; + course_learning_outcomes: CourseLearningOutcome[]; + course_learning_structures: CourseLearningStructure[]; + course_facilities: CourseFaculty[]; + modules: CourseModule[]; + course_resources: CourseResource[]; + course_certificate: CourseCertificate | null; + recommended_courses: RecommendedCourse[]; +} + +export interface CourseDetailResponse { + success: boolean; + status: number; + message: string; + data: CourseDetail; + errors: unknown; + correlation_id: string; +} + +/* ================= PREPOPULATE TYPES ================= */ + +export interface CourseCategory { + id: string; + category_name: string; + category_code: string; + display_order: number; + is_active: boolean; +} + +export interface GetCourseCategoriesParams { + limit?: number; + offset?: number; + is_active?: boolean; +} + +export interface CourseCategoriesResponse { + success: boolean; + status: number; + message: string; + data: { + pagination_info: { + total_count: number; + limit: number; + offset: number; + }; + items: CourseCategory[]; + }; +} + +/* ================= API ================= */ + +export const courseApi = createApi({ + reducerPath: "courseApi", + baseQuery: baseQueryWithReauth, + tagTypes: ["Course", "CourseCategories"], + endpoints: (builder) => ({ + // GET Courses + getCourses: builder.query({ + query: (params) => { + const searchParams = new URLSearchParams(); + + if (params) { + if (params.limit) searchParams.append("limit", params.limit.toString()); + if (params.offset) searchParams.append("offset", params.offset.toString()); + if (params.status) searchParams.append("status", params.status); + if (params.search_query) searchParams.append("search_query", params.search_query); + if (params.price_range) searchParams.append("price_range", params.price_range); + if (params.duration_range) searchParams.append("duration_range", params.duration_range); + if (params.min_rating !== undefined) + searchParams.append("min_rating", params.min_rating.toString()); + if (params.sort_by) searchParams.append("sort_by", params.sort_by); + + // ✅ array support + if (params.course_category?.length) { + params.course_category.forEach((cat) => { + searchParams.append("course_category", cat); + }); + } + } + + const queryString = searchParams.toString(); + + return queryString + ? `admin/course/list?${queryString}` + : `admin/course/list`; + }, + + providesTags: (result) => + result + ? [ + ...result.data.items.map(({ id }) => ({ + type: "Course" as const, + id, + })), + { type: "Course", id: "LIST" }, + ] + : [{ type: "Course", id: "LIST" }], + }), + + // GET Course Categories (Prepopulate) + getCourseCategories: builder.query({ + query: (params) => { + const searchParams = new URLSearchParams(); + if (params) { + if (params.limit) searchParams.append("limit", params.limit.toString()); + if (params.offset) searchParams.append("offset", params.offset.toString()); + if (params.is_active !== undefined) searchParams.append("is_active", params.is_active.toString()); + } + const queryString = searchParams.toString(); + return queryString + ? `admin/prepopulate/course-categories/list?${queryString}` + : `admin/prepopulate/course-categories/list`; + }, + providesTags: ["CourseCategories"], + }), + + // GET Course By Id + getcoursebyid: builder.query({ + query: (course_id) => `admin/course/${course_id}`, + providesTags: (_result, _error, course_id) => [{ type: "Course", id: course_id }], + }), + + + }), +}); + +export const { + useGetCoursesQuery, + useGetCourseCategoriesQuery, + useGetcoursebyidQuery, +} = courseApi; diff --git a/src/redux/services/homepageApi.ts b/src/redux/services/homepageApi.ts index 817150e..3bf35b8 100644 --- a/src/redux/services/homepageApi.ts +++ b/src/redux/services/homepageApi.ts @@ -28,6 +28,7 @@ export interface StatItem { /* ================= HIGHLIGHT CARD ================= */ export interface HighlightCard { + id?: string; card_title: string; icon_url: string; accessible_label: string; @@ -46,6 +47,31 @@ export interface CtaBand { cta_destination: string; } +/* ================= TESTIMONIAL TYPES ================= */ + +export interface TestimonialItem { + id: string; + profile_xid: string; + name: string; + designation: string; + content: string; + video_url: string | null; + display_order: number; +} + +/* ================= CTA SECTION TYPES ================= */ + +export interface CtaSection { + id: string; + background_image_url: string; + text: string; + cta_text: string; + cta_destination: string; + description: string; + landing_page_type: string; + service_type: string | null; +} + /* ================= RESPONSE ================= */ export interface HomePageResponse { @@ -57,6 +83,8 @@ export interface HomePageResponse { stats_sections: StatItem[]; highlight_cards: HighlightCard[]; cta_bands: CtaBand[]; + cta_section: CtaSection; + testimonial_section: TestimonialItem[]; }; errors: any; correlation_id: string; diff --git a/src/redux/services/learningFacilityApi.ts b/src/redux/services/learningFacilityApi.ts new file mode 100644 index 0000000..aa9fbd5 --- /dev/null +++ b/src/redux/services/learningFacilityApi.ts @@ -0,0 +1,122 @@ +import { createApi } from "@reduxjs/toolkit/query/react"; +import baseQueryWithReauth from "./baseQuery"; + +export interface KautilyaPageResponse { + success: boolean; + status: number; + message: string; + data: { + hero_sections: { + id: string; + background_image_url: string; + background_image_alt_text: string; + headline: string; + subtext: string; + cta_text: string; + cta_destination: string; + }; + our_story: { + id: string; + tag: string; + title: string; + content: string; + image_url: string; + }; + why_choose_us: { + id: string; + tag: string; + title: string; + description: string; + cards: Array<{ + id: string; + title: string; + description: string; + image_url: string; + icon: string; + display_order: number; + bullets: Array<{ + id: string; + text: string; + }>; + }>; + }; + facility_features: { + id: string; + title: string; + description: string; + features: Array<{ + id: string; + title: string; + description: string; + image_url: string; + sub_title: string; + sub_description: string; + display_order: number; + points: Array<{ + id: string; + text: string; + }>; + }>; + }; + visual_tour: { + id: string; + title: string; + description: string; + categories: Array<{ + id: string; + name: string; + display_order: number; + images: Array<{ + id: string; + image_url: string; + title: string; + subtitle: string; + display_order: number; + }>; + }>; + }; + daily_experience: { + id: string; + title: string; + description: string; + items: Array<{ + id: string; + label: string; + title: string; + description: string; + image_url: string; + display_order: number; + }>; + }; + cta_section: { + id: string; + background_image_url: string; + text: string; + cta_text: string; + cta_destination: string; + description: string; + }; + }; + errors: any; + correlation_id: string; +} + +export const learningFacilityApi = createApi({ + reducerPath: "learningFacilityApi", + baseQuery: baseQueryWithReauth, + tagTypes: ["KautilyaPage"], + endpoints: (builder) => ({ + getKautilyaPage: builder.query< + KautilyaPageResponse["data"], + { } + >({ + query: ({ }) => ({ + url: "/admin/kautilya-page/get", + }), + transformResponse: (response: KautilyaPageResponse) => response.data, + providesTags: [{ type: "KautilyaPage", id: "LIST" }], + }), + }), +}); + +export const { useGetKautilyaPageQuery } = learningFacilityApi; \ No newline at end of file diff --git a/src/redux/services/sercicesApi.ts b/src/redux/services/sercicesApi.ts new file mode 100644 index 0000000..2dc6824 --- /dev/null +++ b/src/redux/services/sercicesApi.ts @@ -0,0 +1,20 @@ +import { createApi } from "@reduxjs/toolkit/query/react"; +import baseQueryWithReauth from "./baseQuery"; + +export const sercicesApi = createApi({ + reducerPath: "sercicesApi", + baseQuery: baseQueryWithReauth, + tagTypes: ["services"], + endpoints: (builder) => ({ + // GET services LIST + + getServiceList: builder.query({ + query: ({ service_type }) => ({ + url: `/admin/service-page/list`, + params: { service_type }, + }), + }), + }), +}); + +export const { useGetServiceListQuery } = sercicesApi; diff --git a/src/redux/services/webinarApi.ts b/src/redux/services/webinarApi.ts new file mode 100644 index 0000000..4aeb897 --- /dev/null +++ b/src/redux/services/webinarApi.ts @@ -0,0 +1,128 @@ +import { createApi, fetchBaseQuery } from "@reduxjs/toolkit/query/react"; +import baseQueryWithReauth from "./baseQuery"; + +/* ================= TYPES ================= */ + +export interface WebinarItem { + id: string; + session_title: string; + description: string | null; + session_datetime: string; + duration_minutes: number; + timezone_xid: string; + max_attendee: number; + passcode: string; + require_registration: boolean; + recurring_webinar: boolean; + webinar_status: "scheduled" | "live" | "ended" | "cancelled"; + owner?: string; +} + +export interface WebinarListData { + total: number; + limit: number; + offset: number; + items: WebinarItem[]; +} + +export interface WebinarListResponse { + success: boolean; + status: number; + message: string; + data: WebinarListData; + errors: any; + correlation_id: string; +} + +/* ================= QUERY PARAM TYPE ================= */ + +export interface WebinarListParams { + limit?: number; + offset?: number; + search?: string; + status?: string[]; // ✅ multiple status + fromDate?: string; + toDate?: string; + minDuration?: number; + maxDuration?: number; + minAttendees?: number; // ✅ NEW + maxAttendees?: number; // ✅ NEW + sortBy?: "most_popular" | "newest" | "oldest" | "title" | "duration"; +} + +/* ================= API ================= */ + +export const webinarApi = createApi({ + reducerPath: "webinarApi", + baseQuery: baseQueryWithReauth, + tagTypes: ["Webinar"], + + endpoints: (builder) => ({ + webinarList: builder.query({ + query: ({ + limit = 10, + offset = 0, + search, + status, + fromDate, + toDate, + minDuration, + maxDuration, + minAttendees, + maxAttendees, + sortBy, + }) => { + const params = new URLSearchParams(); + + params.append("limit", String(limit)); + params.append("offset", String(offset)); + + if (search) { + params.append("search_term", search); // ✅ FIXED NAME + } + + if (status && status.length > 0) { + status.forEach((s) => + params.append("session_status", s) // ✅ array support + ); + } + + if (fromDate) { + params.append("from_date", fromDate); + } + + if (toDate) { + params.append("to_date", toDate); + } + + if (minDuration !== undefined) { + params.append("min_duration", String(minDuration)); + } + + if (maxDuration !== undefined) { + params.append("max_duration", String(maxDuration)); + } + + if (minAttendees !== undefined) { + params.append("min_attendee", String(minAttendees)); // ✅ NEW + } + + if (maxAttendees !== undefined) { + params.append("max_attendee", String(maxAttendees)); // ✅ NEW + } + + if (sortBy) { + params.append("sort_by", sortBy); + } + + return `/admin/webinars/list?${params.toString()}`; + }, + + providesTags: ["Webinar"], + }), + }), +}); + +/* ================= EXPORT HOOK ================= */ + +export const { useWebinarListQuery } = webinarApi; \ No newline at end of file diff --git a/src/redux/store/Store.tsx b/src/redux/store/Store.tsx index 29dc1df..42dbeaf 100644 --- a/src/redux/store/Store.tsx +++ b/src/redux/store/Store.tsx @@ -4,6 +4,10 @@ import { faqApi } from "../services/faqApi"; import { contactUsApi } from "../services/contactUsApi"; import { blogApi } from "../services/blogApi"; import { aboutUsApi } from "../services/aboutUsApi"; +import { sercicesApi } from "../services/sercicesApi"; +import { courseApi } from "../services/courseApi"; +import { learningFacilityApi } from "../services/learningFacilityApi"; +import { webinarApi } from "../services/webinarApi"; export const store = configureStore({ reducer: { @@ -12,6 +16,11 @@ export const store = configureStore({ [contactUsApi.reducerPath]: contactUsApi.reducer, [blogApi.reducerPath]: blogApi.reducer, [aboutUsApi.reducerPath]: aboutUsApi.reducer, + [sercicesApi.reducerPath]: sercicesApi.reducer, + [courseApi.reducerPath]: courseApi.reducer, + [learningFacilityApi.reducerPath]: learningFacilityApi.reducer, + [webinarApi.reducerPath]: webinarApi.reducer, + }, middleware: (getDefaultMiddleware) => getDefaultMiddleware().concat( @@ -20,6 +29,10 @@ export const store = configureStore({ contactUsApi.middleware, blogApi.middleware, aboutUsApi.middleware, + sercicesApi.middleware, + courseApi.middleware, + learningFacilityApi.middleware, + webinarApi.middleware, ), }); diff --git a/src/styles/globals.css b/src/styles/globals.css index 57e4aee..0fa769a 100644 --- a/src/styles/globals.css +++ b/src/styles/globals.css @@ -167,6 +167,9 @@ /* Small text */ --font-small: 0.875rem; /* 14px */ + /* Extra small text */ + --font-extra-small: 0.75rem; + /* 12px */ --line-height-small: 1.5; --font-weight-small: 400; @@ -601,6 +604,14 @@ html { color: var(--color-black); } + .text-small-extra { + font-size: var(--font-extra-small); + line-height: var(--line-height-small); + font-weight: var(--font-weight-small); + font-family: var(--font-family-base); + color: var(--color-black); + } + .text-eyebrow { font-size: var(--font-eyebrow); line-height: var(--line-height-eyebrow); @@ -5294,4 +5305,31 @@ html { font-size: calc(var(--font-h2) * 0.8); /* reduce by 20% */ line-height: calc(var(--line-height-h2) * 0.9); } -} \ No newline at end of file +} + + .custom-scrollbar { + scrollbar-width: thin; + scrollbar-color: transparent transparent; + } + + .custom-scrollbar::-webkit-scrollbar { + width: 6px; + } + + .custom-scrollbar::-webkit-scrollbar-track { + background: transparent; + } + + .custom-scrollbar::-webkit-scrollbar-thumb { + background-color: transparent; + border-radius: 20px; + } + + /* Optional: Show scrollbar only on hover */ + .custom-scrollbar:hover::-webkit-scrollbar-thumb { + background-color: rgba(0, 0, 0, 0.2); + } + + .custom-scrollbar:hover { + scrollbar-color: rgba(0, 0, 0, 0.2) transparent; + } \ No newline at end of file