/* IGI — Top Nav, Mobile Drawer, Footer, Sticky CTA, Chat Widget */ const Logo = ({ light }) => ( IGI IGI General Insurance · since 1953 ); const PRODUCTS = [ { id: 'igi-drive', label: 'IGI Drive', icon: I.Zap, desc: 'Smart motor cover with telematics rewards', badge: 'NEW', href: 'igidrive/igi-drive.html' }, { id: 'igi-vitality-drive', label: 'IGI Vitality Drive', icon: I.Sparkles, desc: 'Drive safer, live healthier — earn rewards', badge: 'NEW', href: 'igidrive/igi-vitality-drive.html' }, { id: 'motor', label: 'Motor', icon: I.Car, desc: 'Private cars, commercial vehicles & bikes' }, { id: 'home-prop', label: 'Home & Property', icon: I.Home, desc: 'Houseowner, householder & rent' }, { id: 'travel', label: 'Travel', icon: I.Plane, desc: 'International & domestic plans' }, { id: 'health', label: 'Health', icon: I.Heart, desc: 'Individual & family medical cover' }, { id: 'marine', label: 'Marine', icon: I.Anchor, desc: 'Cargo, hull & freight' }, { id: 'fire', label: 'Fire & Allied', icon: I.Flame, desc: 'Industrial, commercial & residential' }, { id: 'engineering', label: 'Engineering', icon: I.HardHat, desc: 'CAR, EAR, machinery breakdown' }, { id: 'liability', label: 'Liability', icon: I.Scale, desc: 'Public, product & professional' }, { id: 'crop', label: 'Crop', icon: I.Wheat, desc: 'Yield-index & weather-based' }, { id: 'corporate', label: 'Group / Corporate', icon: I.Building, desc: 'Tailored solutions for businesses' }, ]; function Nav({ route, navigate }) { const [productsOpen, setProductsOpen] = React.useState(false); const [mobileOpen, setMobileOpen] = React.useState(false); const [scrolled, setScrolled] = React.useState(false); const [lang, setLang] = React.useState('EN'); React.useEffect(() => { const onScroll = () => setScrolled(window.scrollY > 4); window.addEventListener('scroll', onScroll); return () => window.removeEventListener('scroll', onScroll); }, []); const closeAll = () => { setProductsOpen(false); setMobileOpen(false); }; const links = [ { id: 'claims', label: 'Claims' }, { id: 'locator', label: 'Find Hospital / Workshop' }, { id: 'about', label: 'About' }, { id: 'contact', label: 'Contact' }, ]; return ( <> {/* Top utility bar */}
UAN Helpline: 021-111-308-308 · claims@igi.com.pk
|
{/* Mobile drawer */} {mobileOpen && (
setMobileOpen(false)} style={{ position: 'fixed', inset: 0, background: 'rgba(6,26,48,0.5)', zIndex: 100, backdropFilter: 'blur(4px)', }} >
e.stopPropagation()} style={{ position: 'absolute', right: 0, top: 0, bottom: 0, width: 'min(360px, 90vw)', background: 'white', padding: '20px 24px', overflowY: 'auto', animation: 'fadeUp 0.25s ease', }} >
Products
{PRODUCTS.slice(0, 6).map(p => ( ))}
{links.map(l => ( ))}
021-111-308-308
claims@igi.com.pk
)} ); } function Footer({ navigate }) { return ( ); } function FooterCol({ title, links, navigate }) { return (
{title}
{links.map(([label, route]) => ( ))}
); } function StickyCTA({ navigate, route }) { const [show, setShow] = React.useState(false); React.useEffect(() => { const onScroll = () => setShow(window.scrollY > 600); window.addEventListener('scroll', onScroll); return () => window.removeEventListener('scroll', onScroll); }, []); if (!show || route === 'quote' || route === 'dashboard') return null; return (
Get a no-obligation quote in 2 minutes
); } function ChatWidget() { const [open, setOpen] = React.useState(false); const [messages, setMessages] = React.useState([ { from: 'bot', text: 'Salam! 👋 I\'m Ayla, your IGI assistant. How can I help you today?' }, { from: 'bot', text: 'You can ask about quotes, claims, hospital network, or policy renewal.', chips: ['Get a quote', 'Track my claim', 'Find hospital', 'Renew policy'] }, ]); const [input, setInput] = React.useState(''); const scrollRef = React.useRef(); React.useEffect(() => { if (scrollRef.current) scrollRef.current.scrollTop = scrollRef.current.scrollHeight; }, [messages, open]); const send = (text) => { if (!text.trim()) return; setMessages(m => [...m, { from: 'user', text }]); setInput(''); setTimeout(() => { setMessages(m => [...m, { from: 'bot', text: text.toLowerCase().includes('claim') ? 'I can help track your claim. Please share your claim ID (format: CLM-YYYY-XXXX) or your CNIC.' : text.toLowerCase().includes('quote') ? 'Let\'s get you a quote! What would you like to insure?' : 'Got it. Let me connect you with the right specialist. One moment please…', }]); }, 700); }; return ( <> {open && (
A
Ayla — IGI Assistant
Average reply time: 30s
{messages.map((m, i) => (
{m.text}
{m.chips && (
{m.chips.map(c => ( ))}
)}
))}
{ e.preventDefault(); send(input); }} style={{ padding: 12, borderTop: '1px solid var(--ink-200)', display: 'flex', gap: 8, }}> setInput(e.target.value)} placeholder="Type a message…" style={{ flex: 1, padding: '10px 14px', border: '1px solid var(--ink-200)', borderRadius: 999, outline: 'none', fontSize: 14, }} />
)} ); } Object.assign(window, { Nav, Footer, StickyCTA, ChatWidget, Logo, PRODUCTS });