/* 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
navigate('dashboard')} style={{ color: 'white', fontSize: 12, display: 'inline-flex', alignItems: 'center', gap: 4 }}>
My Account
|
setLang(lang === 'EN' ? 'اردو' : 'EN')} style={{ color: 'white', fontSize: 12, display: 'inline-flex', alignItems: 'center', gap: 4 }}>
{lang}
{/* 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',
}}
>
setMobileOpen(false)} aria-label="Close menu" style={{ padding: 8 }}>
Products
{PRODUCTS.slice(0, 6).map(p => (
{ if (p.href) { window.location.href = p.href; } else { navigate(p.id); } closeAll(); }}
style={{
display: 'flex', alignItems: 'center', gap: 12,
padding: '10px 0', width: '100%', textAlign: 'left',
borderBottom: '1px solid var(--ink-100)',
}}
>
{p.label}
))}
{links.map(l => (
{ navigate(l.id); closeAll(); }}
style={{ padding: '12px 0', textAlign: 'left', fontWeight: 600, borderBottom: '1px solid var(--ink-100)' }}
>
{l.label}
))}
{ navigate('quote'); closeAll(); }}>
Get a Quote
{ navigate('claims'); closeAll(); }}>
File a Claim
021-111-308-308
claims@igi.com.pk
)}
>
);
}
function Footer({ navigate }) {
return (
Pakistan's trusted general insurer for over seven decades. We protect what matters — vehicles, homes, businesses, journeys and lives — with policies designed for clarity and claims handled with care.
{['AM Best', 'PACRA AA+', 'IFS Strong'].map(r => (
{r}
))}
© 2026 IGI General Ltd. Registered with the Securities & Exchange Commission of Pakistan.
);
}
function FooterCol({ title, links, navigate }) {
return (
{title}
{links.map(([label, route]) => (
navigate(route)}
style={{ textAlign: 'left', fontSize: 14, color: 'rgba(255,255,255,0.7)', padding: 0 }}
onMouseEnter={e => e.currentTarget.style.color = 'white'}
onMouseLeave={e => e.currentTarget.style.color = 'rgba(255,255,255,0.7)'}
>
{label}
))}
);
}
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
navigate('quote')}>
Start
);
}
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 (
<>
setOpen(o => !o)} aria-label="Open chat">
{open ? : }
{open && (
A
Ayla — IGI Assistant
Average reply time: 30s
{messages.map((m, i) => (
{m.text}
{m.chips && (
{m.chips.map(c => (
send(c)} style={{
padding: '6px 12px', fontSize: 12, fontWeight: 600,
background: 'white', border: '1px solid var(--blue-100)',
color: 'var(--blue-700)', borderRadius: 999,
}}>{c}
))}
)}
))}
)}
>
);
}
Object.assign(window, { Nav, Footer, StickyCTA, ChatWidget, Logo, PRODUCTS });