import React from 'react'; import { Wifi, Tv, Wind, Coffee, Utensils, Car, Dumbbell, Waves, UtensilsCrossed, Shield, Cigarette, Bath, Home, Bed, Sofa, Key, Phone, Zap, Gamepad2, Music, Sparkles, Flame, Lock, Heart, MapPin, Building, Users, Laptop, Smartphone, Monitor, Headphones, UtensilsCrossed as Restaurant, Briefcase, Printer, Clock, Sunrise, Moon, Eye, Ear, Accessibility, Baby as BabyIcon, PawPrint, Radio as RadioIcon, Flame as Fireplace, } from 'lucide-react'; interface RoomAmenitiesProps { amenities: string[]; } const RoomAmenities: React.FC = ({ amenities }) => { const normalizeAmenities = (input: any): string[] => { if (Array.isArray(input)) return input; if (!input) return []; if (typeof input === 'string') { try { const parsed = JSON.parse(input); if (Array.isArray(parsed)) return parsed; } catch (e) { } return input .split(',') .map((s) => s.trim()) .filter(Boolean); } if (typeof input === 'object') { try { const vals = Object.values(input); if (Array.isArray(vals) && vals.length > 0) { return vals.flat().map((v: any) => String(v).trim()).filter(Boolean); } } catch (e) { } } return []; }; const safeAmenities = normalizeAmenities(amenities); const amenityIcons: Record = { wifi: , 'wi-fi': , 'free wifi': , 'wifi in room': , 'high-speed internet': , tv: , television: , 'flat-screen tv': , 'cable tv': , 'satellite tv': , 'smart tv': , netflix: , 'streaming services': , 'dvd player': , 'stereo system': , radio: , 'ipod dock': , 'blu-ray player': , 'gaming console': , playstation: , xbox: , 'sound system': , 'surround sound': , 'music system': , 'air-conditioning': , 'air conditioning': , ac: , heating: , 'climate control': , 'ceiling fan': , 'air purifier': , 'private bathroom': , 'ensuite bathroom': , bathtub: , 'jacuzzi bathtub': , 'hot tub': , shower: , 'rain shower': , 'walk-in shower': , 'steam shower': , bidet: , 'hair dryer': , hairdryer: , bathrobes: , slippers: , toiletries: , 'premium toiletries': , towels: , 'mini bar': , minibar: , refrigerator: , fridge: , microwave: , 'coffee maker': , 'electric kettle': , kettle: , 'tea making facilities': , 'coffee machine': , 'nespresso machine': , kitchenette: , 'dining table': , 'room service': , 'breakfast included': , breakfast: , 'complimentary water': , 'bottled water': , desk: , 'writing desk': , 'office desk': , 'work desk': , sofa: , 'sitting area': , 'lounge area': , 'dining area': , 'separate living area': , wardrobe: , closet: , dresser: , mirror: , 'full-length mirror': , 'seating area': , 'king size bed': , 'queen size bed': , 'double bed': , 'twin beds': , 'single bed': , 'extra bedding': , 'pillow menu': , 'premium bedding': , 'blackout curtains': , soundproofing: , safe: , 'in-room safe': , 'safety deposit box': , 'smoke detector': , 'fire extinguisher': , 'security system': , 'key card access': , 'door lock': , 'usb charging ports': , 'usb ports': , 'usb outlets': , 'power outlets': , 'charging station': , 'laptop safe': , 'hdmi port': , phone: , 'desk phone': , 'wake-up service': , 'alarm clock': , 'digital clock': , balcony: , 'private balcony': , terrace: , patio: , 'city view': , 'ocean view': , 'sea view': , 'mountain view': , 'garden view': , 'pool view': , 'park view': , window: , 'large windows': , 'floor-to-ceiling windows': , '24-hour front desk': , '24 hour front desk': , '24/7 front desk': , 'front desk': , 'concierge service': , 'butler service': , butler: , housekeeping: , 'daily housekeeping': , 'turndown service': , 'laundry service': , laundry: , 'dry cleaning': , 'ironing service': , 'luggage storage': , 'bell service': , 'valet parking': , parking: , 'free parking': , 'airport shuttle': , 'shuttle service': , shuttle: , 'car rental': , 'taxi service': , 'gym access': , 'fitness center': , 'fitness room': , gym: , fitness: , 'spa access': , spa: , sauna: , 'steam room': , 'massage service': , 'beauty services': , 'swimming pool': , pool: , 'indoor pool': , 'outdoor pool': , 'infinity pool': , 'pool access': , 'golf course': , 'tennis court': , 'beach access': , 'water sports': , 'business center': , 'meeting room': , 'conference room': , 'fax service': , photocopying: , 'printing service': , 'secretarial services': , 'wheelchair accessible': , 'accessible room': , 'elevator access': , 'ramp access': , 'accessible bathroom': , 'lowered sink': , 'grab bars': , 'hearing accessible': , 'visual alarm': , 'family room': , 'kids welcome': , 'baby crib': , crib: , 'extra bed': , 'childcare services': , 'pets allowed': , pets: , 'pet friendly': , 'smoking room': , 'non-smoking room': , 'no smoking': , 'interconnecting rooms': , 'adjoining rooms': , suite: , 'separate bedroom': , kitchen: , 'full kitchen': , dishwasher: , oven: , stove: , 'washing machine': , dryer: , iron: , 'ironing board': , 'clothes rack': , umbrella: , 'shoe shine service': , fireplace: , jacuzzi: , 'spa bath': , 'bidet toilet': , 'smart home system': , 'lighting control': , 'curtain control': , 'automated systems': , 'personalized service': , 'vip treatment': , 'private entrance': , 'private elevator': , 'panic button': , restaurant: , library: , 'reading room': , 'study room': , 'private pool': , 'private garden': , yard: , courtyard: , 'outdoor furniture': , 'bbq facilities': , 'picnic area': , }; const amenityLabels: Record = { wifi: 'Wi‑Fi', 'wi-fi': 'Wi‑Fi', 'free wifi': 'Free WiFi', 'wifi in room': 'WiFi in Room', 'high-speed internet': 'High-Speed Internet', tv: 'TV', television: 'TV', 'flat-screen tv': 'Flat-Screen TV', 'cable tv': 'Cable TV', 'satellite tv': 'Satellite TV', 'smart tv': 'Smart TV', netflix: 'Netflix', 'streaming services': 'Streaming Services', 'dvd player': 'DVD Player', 'stereo system': 'Stereo System', radio: 'Radio', 'ipod dock': 'iPod Dock', 'blu-ray player': 'Blu-ray Player', 'gaming console': 'Gaming Console', playstation: 'PlayStation', xbox: 'Xbox', 'sound system': 'Sound System', 'surround sound': 'Surround Sound', 'music system': 'Music System', 'air-conditioning': 'Air Conditioning', 'air conditioning': 'Air Conditioning', ac: 'Air Conditioning', heating: 'Heating', 'climate control': 'Climate Control', 'ceiling fan': 'Ceiling Fan', 'air purifier': 'Air Purifier', 'private bathroom': 'Private Bathroom', 'ensuite bathroom': 'Ensuite Bathroom', bathtub: 'Bathtub', 'jacuzzi bathtub': 'Jacuzzi Bathtub', 'hot tub': 'Hot Tub', shower: 'Shower', 'rain shower': 'Rain Shower', 'walk-in shower': 'Walk-in Shower', 'steam shower': 'Steam Shower', bidet: 'Bidet', 'hair dryer': 'Hair Dryer', hairdryer: 'Hair Dryer', bathrobes: 'Bathrobes', slippers: 'Slippers', toiletries: 'Toiletries', 'premium toiletries': 'Premium Toiletries', towels: 'Towels', 'mini bar': 'Mini Bar', minibar: 'Mini Bar', refrigerator: 'Refrigerator', fridge: 'Refrigerator', microwave: 'Microwave', 'coffee maker': 'Coffee Maker', 'electric kettle': 'Electric Kettle', kettle: 'Electric Kettle', 'tea making facilities': 'Tea Making Facilities', 'coffee machine': 'Coffee Machine', 'nespresso machine': 'Nespresso Machine', kitchenette: 'Kitchenette', 'dining table': 'Dining Table', 'room service': 'Room Service', 'breakfast included': 'Breakfast Included', breakfast: 'Breakfast Included', 'complimentary water': 'Complimentary Water', 'bottled water': 'Bottled Water', desk: 'Desk', 'writing desk': 'Writing Desk', 'office desk': 'Office Desk', 'work desk': 'Work Desk', sofa: 'Sofa', 'sitting area': 'Sitting Area', 'lounge area': 'Lounge Area', 'dining area': 'Dining Area', 'separate living area': 'Separate Living Area', wardrobe: 'Wardrobe', closet: 'Closet', dresser: 'Dresser', mirror: 'Mirror', 'full-length mirror': 'Full-Length Mirror', 'seating area': 'Seating Area', 'king size bed': 'King Size Bed', 'queen size bed': 'Queen Size Bed', 'double bed': 'Double Bed', 'twin beds': 'Twin Beds', 'single bed': 'Single Bed', 'extra bedding': 'Extra Bedding', 'pillow menu': 'Pillow Menu', 'premium bedding': 'Premium Bedding', 'blackout curtains': 'Blackout Curtains', soundproofing: 'Soundproofing', safe: 'Safe', 'in-room safe': 'In-Room Safe', 'safety deposit box': 'Safety Deposit Box', 'smoke detector': 'Smoke Detector', 'fire extinguisher': 'Fire Extinguisher', 'security system': 'Security System', 'key card access': 'Key Card Access', 'door lock': 'Door Lock', 'usb charging ports': 'USB Charging Ports', 'usb ports': 'USB Ports', 'usb outlets': 'USB Outlets', 'power outlets': 'Power Outlets', 'charging station': 'Charging Station', 'laptop safe': 'Laptop Safe', 'hdmi port': 'HDMI Port', phone: 'Phone', 'desk phone': 'Desk Phone', 'wake-up service': 'Wake-Up Service', 'alarm clock': 'Alarm Clock', 'digital clock': 'Digital Clock', balcony: 'Balcony', 'private balcony': 'Private Balcony', terrace: 'Terrace', patio: 'Patio', 'city view': 'City View', 'ocean view': 'Ocean View', 'sea view': 'Sea View', 'mountain view': 'Mountain View', 'garden view': 'Garden View', 'pool view': 'Pool View', 'park view': 'Park View', window: 'Window', 'large windows': 'Large Windows', 'floor-to-ceiling windows': 'Floor-to-Ceiling Windows', '24-hour front desk': '24/7 Front Desk', '24 hour front desk': '24/7 Front Desk', '24/7 front desk': '24/7 Front Desk', 'front desk': 'Front Desk', 'concierge service': 'Concierge Service', 'butler service': 'Butler Service', butler: 'Butler', housekeeping: 'Housekeeping', 'daily housekeeping': 'Daily Housekeeping', 'turndown service': 'Turndown Service', 'laundry service': 'Laundry Service', laundry: 'Laundry Service', 'dry cleaning': 'Dry Cleaning', 'ironing service': 'Ironing Service', 'luggage storage': 'Luggage Storage', 'bell service': 'Bell Service', 'valet parking': 'Valet Parking', parking: 'Parking', 'free parking': 'Free Parking', 'airport shuttle': 'Airport Shuttle', 'shuttle service': 'Shuttle Service', shuttle: 'Shuttle Service', 'car rental': 'Car Rental', 'taxi service': 'Taxi Service', 'gym access': 'Gym Access', 'fitness center': 'Fitness Center', 'fitness room': 'Fitness Room', gym: 'Gym', fitness: 'Fitness Center', 'spa access': 'Spa Access', spa: 'Spa', sauna: 'Sauna', 'steam room': 'Steam Room', 'massage service': 'Massage Service', 'beauty services': 'Beauty Services', 'swimming pool': 'Swimming Pool', pool: 'Swimming Pool', 'indoor pool': 'Indoor Pool', 'outdoor pool': 'Outdoor Pool', 'infinity pool': 'Infinity Pool', 'pool access': 'Pool Access', 'golf course': 'Golf Course', 'tennis court': 'Tennis Court', 'beach access': 'Beach Access', 'water sports': 'Water Sports', 'business center': 'Business Center', 'meeting room': 'Meeting Room', 'conference room': 'Conference Room', 'fax service': 'Fax Service', photocopying: 'Photocopying', 'printing service': 'Printing Service', 'secretarial services': 'Secretarial Services', 'wheelchair accessible': 'Wheelchair Accessible', 'accessible room': 'Accessible Room', 'elevator access': 'Elevator Access', 'ramp access': 'Ramp Access', 'accessible bathroom': 'Accessible Bathroom', 'lowered sink': 'Lowered Sink', 'grab bars': 'Grab Bars', 'hearing accessible': 'Hearing Accessible', 'visual alarm': 'Visual Alarm', 'family room': 'Family Room', 'kids welcome': 'Kids Welcome', 'baby crib': 'Baby Crib', crib: 'Baby Crib', 'extra bed': 'Extra Bed', 'childcare services': 'Childcare Services', 'pets allowed': 'Pets Allowed', pets: 'Pets Allowed', 'pet friendly': 'Pet Friendly', 'smoking room': 'Smoking Room', 'non-smoking room': 'Non-Smoking Room', 'no smoking': 'No Smoking', 'interconnecting rooms': 'Interconnecting Rooms', 'adjoining rooms': 'Adjoining Rooms', suite: 'Suite', 'separate bedroom': 'Separate Bedroom', kitchen: 'Kitchen', 'full kitchen': 'Full Kitchen', dishwasher: 'Dishwasher', oven: 'Oven', stove: 'Stove', 'washing machine': 'Washing Machine', dryer: 'Dryer', iron: 'Iron', 'ironing board': 'Ironing Board', 'clothes rack': 'Clothes Rack', umbrella: 'Umbrella', 'shoe shine service': 'Shoe Shine Service', fireplace: 'Fireplace', jacuzzi: 'Jacuzzi', 'spa bath': 'Spa Bath', 'bidet toilet': 'Bidet Toilet', 'smart home system': 'Smart Home System', 'lighting control': 'Lighting Control', 'curtain control': 'Curtain Control', 'automated systems': 'Automated Systems', 'personalized service': 'Personalized Service', 'vip treatment': 'VIP Treatment', 'private entrance': 'Private Entrance', 'private elevator': 'Private Elevator', 'panic button': 'Panic Button', restaurant: 'Restaurant', library: 'Library', 'reading room': 'Reading Room', 'study room': 'Study Room', 'private pool': 'Private Pool', 'private garden': 'Private Garden', yard: 'Yard', courtyard: 'Courtyard', 'outdoor furniture': 'Outdoor Furniture', 'bbq facilities': 'BBQ Facilities', 'picnic area': 'Picnic Area', }; const amenityDescriptions: Record = { wifi: 'Free wireless internet connection', tv: 'TV with cable or satellite', ac: 'Air conditioning system in room', minibar: 'Drinks and snacks in mini bar', pool: 'Outdoor or indoor swimming pool', gym: 'Fitness center/gym', 'room service': 'Order food to room', breakfast: 'Breakfast served at restaurant', balcony: 'Private balcony with view', '24-hour front desk': '24-hour front desk service', spa: 'Spa and relaxation services', }; const getIcon = (amenity: string) => { const key = amenity.toLowerCase().trim(); return amenityIcons[key] || ( ); }; const getLabel = (amenity: string) => { const key = amenity.toLowerCase().trim(); if (amenityLabels[key]) return amenityLabels[key]; return amenity .toLowerCase() .replace(/[_-]/g, ' ') .split(' ') .map((s) => s.charAt(0).toUpperCase() + s.slice(1)) .join(' '); }; const getDescription = (amenity: string) => { const key = amenity.toLowerCase().trim(); return amenityDescriptions[key] || ''; }; if (safeAmenities.length === 0) { return (
Amenity information is being updated
); } return (
{safeAmenities.map((amenity, index) => (
{getIcon(amenity)}
{getLabel(amenity)}
{getDescription(amenity) && (
{getDescription(amenity)}
)}
))}
); }; export default RoomAmenities;