import React, { useState } from 'react'; import { Link } from 'react-router-dom'; import { CheckCircle2, Phone, Star, ChevronDown, ChevronUp, MapPin, Mail, Fuel, CloudRain, Volume2, Lock, ShieldCheck, Wrench, Clock, Award, Users, Search, Car, Settings, Battery, Thermometer, Droplet, Instagram, Facebook, Twitter, Youtube, Linkedin, ArrowLeftRight } from 'lucide-react'; import { Button, Container, SectionTitle, cn } from './Shared'; import { useData } from '../contexts/DataContext'; import { FooterColumn } from '../types'; // ---- HELPERS ---- const IconResolver = ({ name, size = 24, className }: { name: string, size?: number, className?: string }) => { const icons: any = { ShieldCheck, Wrench, Clock, Award, Users, Search, Car, Settings, Battery, Thermometer, Droplet }; const Icon = icons[name] || Settings; return ; }; // ---- SUB-COMPONENTS ---- const FeatureItem: React.FC<{ icon: string, title: string, description: string }> = ({ icon, title, description }) => (

{title}

{description}

); const ServiceCard: React.FC<{ service: any, whatsappLink: string }> = ({ service, whatsappLink }) => (
{service.title}

{service.title}

{service.description}

Agendar
); const PackageCard: React.FC<{ pkg: any, whatsappLink: string }> = ({ pkg, whatsappLink }) => (
{pkg.recommended && (
Mais Popular
)}

{pkg.name}

R$ {pkg.price} / serviço
); const AccordionItem: React.FC<{ faq: any }> = ({ faq }) => { const [isOpen, setIsOpen] = React.useState(false); return (

{faq.answer}

); }; // Componente Antes e Depois Slider const BeforeAfterSlider: React.FC<{ before: string, after: string, title: string }> = ({ before, after, title }) => { const [sliderPosition, setSliderPosition] = useState(50); const [isDragging, setIsDragging] = useState(false); const handleMove = (event: React.MouseEvent | React.TouchEvent) => { if (!isDragging) return; const rect = event.currentTarget.getBoundingClientRect(); const x = 'touches' in event ? event.touches[0].clientX : (event as React.MouseEvent).clientX; const position = ((x - rect.left) / rect.width) * 100; setSliderPosition(Math.min(100, Math.max(0, position))); }; return (

{title}

setIsDragging(true)} onMouseUp={() => setIsDragging(false)} onMouseLeave={() => setIsDragging(false)} onMouseMove={handleMove} onTouchStart={() => setIsDragging(true)} onTouchEnd={() => setIsDragging(false)} onTouchMove={handleMove} > Depois
Antes {/* Trick to keep image fixed */} {/* Fix for width calculation in simple implementation: better to just let it fit container */}
{/* Layer to prevent drag issues */} Antes
{/* Handle */}
{/* Labels */}
ANTES
DEPOIS
{/* Alternative slider logic for better compatibility if custom drag fails often */} setSliderPosition(Number(e.target.value))} className="absolute inset-0 w-full h-full opacity-0 cursor-ew-resize z-20" />
); }; // ---- SECTIONS ---- export const SpecialOffersSection = () => { const { data, getWhatsAppLink } = useData(); const t = data.texts.specialOffers; return (
{t.badge}

{t.title}

{t.subtitle}

{data.specialOffers.map((offer) => (
🛍️ RETIRE NA LOJA
INMETRO
{offer.title}
{offer.specs.fuel}
{offer.specs.grip}
{offer.specs.noise}

{offer.title}

{[...Array(5)].map((_, i) => ( ))}
({offer.reviews})
{offer.price}
No PIX ou {offer.installment}
))}
); }; export const AboutSection = () => { const { data } = useData(); const t = data.texts.about; return (
{data.promises.map((item, idx) => )}
Mecânico
{t.badgeYear} {t.badgeText}
); }; export const ServicesSection = () => { const { data, getWhatsAppLink } = useData(); const t = data.texts.services; return (
{data.services.map((s) => )}
); }; export const BigCTA = () => { const { data, getWhatsAppLink } = useData(); const t = data.texts.bigCta; const handleCall = () => { window.open(getWhatsAppLink("Olá! Preciso de ajuda imediata/emergência."), '_blank'); }; return (
Carro preto

{t.title}

{data.settings.contactPhoneDisplay}
{t.buttonText}

{t.subtitle}

); }; export const PackagesSection = () => { const { data, getWhatsAppLink } = useData(); const t = data.texts.packages; return (
{data.packages.map((p, i) => )}
); }; export const GallerySection = () => { const { data } = useData(); const t = data.texts.gallery; return ( ); }; // --- NOVA SEÇÃO DE ANTES E DEPOIS --- export const BeforeAfterSection = () => { const { data } = useData(); const t = data.texts.beforeAfter; return (
{data.beforeAfter.map((item) => ( ))}
); }; export const StatsSection = () => { const { data } = useData(); return (
{data.stats.map((s, i) => (
{s.value}
{s.label}
))}
); }; export const WhyChooseSection = () => { const { data } = useData(); const t = data.texts.whyChoose; return (
{data.whyChoose.map((item, i) => (

{item.text}

))}
Carro Vermelho
); }; export const TestimonialsSection = () => { const { data } = useData(); const t = data.texts.testimonials; return (
{data.testimonials.map((t, i) => (
{[...Array(5)].map((_, i) => )}

"{t.text}"

{t.name}

{t.name}

{t.role}

))}
); }; export const TeamSection = () => { const { data } = useData(); const t = data.texts.team; return (
{data.team.map((member, i) => (
{member.name}

{member.name}

{member.role}

))}
); }; export const FaqSection = () => { const { data } = useData(); const t = data.texts.faq; return (
{data.faqs.map((faq, i) => )}
); }; export const BlogSection = () => { const { data } = useData(); const t = data.texts.blog; return (
{data.blog.map((post, i) => (
{post.title}
{post.date}

{post.title}

{post.excerpt}

Ler mais
))}
); }; export const ContactSection = () => { const { data } = useData(); const t = data.texts.contact; return (

{t.description}

Endereço

{data.settings.address}

Telefone

{data.settings.contactPhoneDisplay}

Email

{data.settings.contactEmail}

); }; export const ClientsSection = () => { const { data } = useData(); return (

Empresas que confiam na CAR

{data.clients.map((client, i) => ( client.url ? ( {client.name} ) : ( {client.name} ) ))}
); }; // Renderiza o conteúdo de uma coluna baseado no tipo const FooterColumnRenderer: React.FC<{ column: FooterColumn }> = ({ column }) => { const { data } = useData(); if (column.type === 'services_dynamic') { return (

{column.title}

    {data.services.slice(0, 4).map((s) => (
  • {s.title}
  • ))}
); } if (column.type === 'hours') { return (

{column.title}

  • Seg - Sex: 08h - 18h
  • Sábado: 08h - 14h
  • Emergência 24h: {data.settings.contactPhoneDisplay}
); } if (column.type === 'custom' && column.links) { return (

{column.title}

    {column.links.map((link, idx) => (
  • {link.href.startsWith('/') ? ( {link.label} ) : ( {link.label} )}
  • ))}
); } return null; } export const Footer = () => { const { data } = useData(); return ( ); };