import React, { useState, useEffect } from 'react'; import { Hotel, Heart, MapPin, Phone, Mail, Linkedin, Twitter } from 'lucide-react'; import * as LucideIcons from 'lucide-react'; import { Link } from 'react-router-dom'; import { pageContentService } from '../services/api'; import type { PageContent } from '../services/api/pageContentService'; import { useCompanySettings } from '../contexts/CompanySettingsContext'; const AboutPage: React.FC = () => { const { settings } = useCompanySettings(); const [pageContent, setPageContent] = useState(null); useEffect(() => { const fetchPageContent = async () => { try { const response = await pageContentService.getAboutContent(); if (response.status === 'success' && response.data?.page_content) { setPageContent(response.data.page_content); if (response.data.page_content.meta_title) { document.title = response.data.page_content.meta_title; } if (response.data.page_content.meta_description) { let metaDescription = document.querySelector('meta[name="description"]'); if (!metaDescription) { metaDescription = document.createElement('meta'); metaDescription.setAttribute('name', 'description'); document.head.appendChild(metaDescription); } metaDescription.setAttribute('content', response.data.page_content.meta_description); } } } catch (err: any) { console.error('Error fetching page content:', err); } }; fetchPageContent(); }, []); const displayPhone = settings.company_phone || '+1 (234) 567-890'; const displayEmail = settings.company_email || 'info@luxuryhotel.com'; const displayAddress = settings.company_address || '123 Luxury Street\nCity, State 12345\nCountry'; const defaultValues = [ { icon: 'Heart', title: 'Passion', description: 'We are passionate about hospitality and dedicated to creating exceptional experiences for every guest.' }, { icon: 'Award', title: 'Excellence', description: 'We strive for excellence in every aspect of our service, from the smallest detail to the grandest gesture.' }, { icon: 'Shield', title: 'Integrity', description: 'We conduct our business with honesty, transparency, and respect for our guests and community.' }, { icon: 'Users', title: 'Service', description: 'Our guests are at the heart of everything we do. Your comfort and satisfaction are our top priorities.' } ]; const defaultFeatures = [ { icon: 'Star', title: 'Premium Accommodations', description: 'Luxuriously appointed rooms and suites designed for ultimate comfort and relaxation.' }, { icon: 'Clock', title: '24/7 Service', description: 'Round-the-clock concierge and room service to attend to your needs at any time.' }, { icon: 'Award', title: 'Award-Winning', description: 'Recognized for excellence in hospitality and guest satisfaction.' } ]; const values = pageContent?.values && pageContent.values.length > 0 ? pageContent.values.map((v: any) => ({ icon: v.icon || defaultValues.find(d => d.title === v.title)?.icon || 'Heart', title: v.title, description: v.description })) : defaultValues; const features = pageContent?.features && pageContent.features.length > 0 ? pageContent.features.map((f: any) => ({ icon: f.icon || defaultFeatures.find(d => d.title === f.title)?.icon || 'Star', title: f.title, description: f.description })) : defaultFeatures; const team = pageContent?.team && typeof pageContent.team === 'string' ? JSON.parse(pageContent.team) : (Array.isArray(pageContent?.team) ? pageContent.team : []); const timeline = pageContent?.timeline && typeof pageContent.timeline === 'string' ? JSON.parse(pageContent.timeline) : (Array.isArray(pageContent?.timeline) ? pageContent.timeline : []); const achievements = pageContent?.achievements && typeof pageContent.achievements === 'string' ? JSON.parse(pageContent.achievements) : (Array.isArray(pageContent?.achievements) ? pageContent.achievements : []); const getIconComponent = (iconName?: string) => { if (!iconName) return Heart; const IconComponent = (LucideIcons as any)[iconName] || Heart; return IconComponent; }; return (
{}
{pageContent?.about_hero_image && (
About Hero
)} {!pageContent?.about_hero_image && (
)}
{!pageContent?.about_hero_image && (
)}

{pageContent?.title || 'About Luxury Hotel'}

{pageContent?.subtitle || pageContent?.description || 'Where Excellence Meets Unforgettable Experiences'}

{}
Our Heritage

Our Story

{pageContent?.story_content ? (
') }} /> ) : ( <>

Welcome to Luxury Hotel, where timeless elegance meets modern sophistication. Since our founding, we have been dedicated to providing exceptional hospitality and creating unforgettable memories for our guests.

Nestled in the heart of the city, our hotel combines classic architecture with contemporary amenities, offering a perfect blend of comfort and luxury. Every detail has been carefully curated to ensure your stay exceeds expectations.

Our commitment to excellence extends beyond our beautiful rooms and facilities. We believe in creating meaningful connections with our guests, understanding their needs, and delivering personalized service that makes each visit special.

)}
{}
Core Principles

Our Values

{values.map((value, index) => (
{(() => { const ValueIcon = getIconComponent(value.icon); return ; })()}

{value.title}

{value.description}

))}
{}
Excellence Defined

Why Choose Us

{features.map((feature, index) => { const FeatureIcon = getIconComponent(feature.icon); return (

{feature.title}

{feature.description}

); })}
{} {(pageContent?.mission || pageContent?.vision) && (
{pageContent.mission && (

Our Mission

{pageContent.mission}

)} {pageContent.vision && (

Our Vision

{pageContent.vision}

)}
)} {} {team && team.length > 0 && (
Meet The Experts

Our Team

{team.map((member: any, index: number) => (
{member.image && (
{member.name}
)}

{member.name}

{member.role}

{member.bio &&

{member.bio}

} {member.social_links && (
{member.social_links.linkedin && ( )} {member.social_links.twitter && ( )}
)}
))}
)} {} {timeline && timeline.length > 0 && (
Our Journey

Our History

{timeline.map((event: any, index: number) => (
{event.year}

{event.title}

{event.description}

{event.image && (
{event.title}
)}
))}
)} {} {achievements && achievements.length > 0 && (
Recognition

Achievements & Awards

{achievements.map((achievement: any, index: number) => { const AchievementIcon = getIconComponent(achievement.icon); return (
{achievement.year && (
{achievement.year}
)}

{achievement.title}

{achievement.description}

{achievement.image && (
{achievement.title}
)}
); })}
)} {}
Connect With Us

Get In Touch

We'd love to hear from you. Contact us for reservations or inquiries.

Address

{displayAddress .split('\n').map((line, i) => ( {line} {i < displayAddress.split('\n').length - 1 &&
}
))}

Explore Our Rooms
); }; export default AboutPage;