/* global React */
// Shared icons -- lucide-style stroke icons, sized per usage.
// All icons are aria-hidden by default; pass aria-label to make accessible.

const Icon = ({ size = 20, stroke = 'currentColor', strokeWidth = 2, children, label, ...rest }) => (
  <svg
    xmlns="http://www.w3.org/2000/svg"
    width={size}
    height={size}
    viewBox="0 0 24 24"
    fill="none"
    stroke={stroke}
    strokeWidth={strokeWidth}
    strokeLinecap="round"
    strokeLinejoin="round"
    aria-hidden={label ? undefined : true}
    aria-label={label}
    role={label ? 'img' : undefined}
    {...rest}
  >
    {children}
  </svg>
);

const IconClock      = (p) => <Icon {...p}><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></Icon>;
const IconShield     = (p) => <Icon {...p}><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/></Icon>;
const IconLock       = (p) => <Icon {...p}><rect x="3" y="11" width="18" height="11" rx="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/></Icon>;
const IconScale      = (p) => <Icon {...p}><path d="M16 16h6l-3-7-3 7zm-14 0h6l-3-7-3 7z"/><path d="M7 21h10"/><path d="M12 3v18"/><path d="M3 7h18"/></Icon>;
const IconMapPin     = (p) => <Icon {...p}><path d="M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0z"/><circle cx="12" cy="10" r="3"/></Icon>;
const IconScan       = (p) => <Icon {...p}><path d="M3 7V5a2 2 0 0 1 2-2h2"/><path d="M17 3h2a2 2 0 0 1 2 2v2"/><path d="M21 17v2a2 2 0 0 1-2 2h-2"/><path d="M7 21H5a2 2 0 0 1-2-2v-2"/><line x1="7" y1="12" x2="17" y2="12"/></Icon>;
const IconTablet     = (p) => <Icon {...p}><rect x="4" y="2" width="16" height="20" rx="2"/><line x1="12" y1="18" x2="12.01" y2="18"/></Icon>;
const IconCheck      = (p) => <Icon {...p}><polyline points="20 6 9 17 4 12"/></Icon>;
const IconX          = (p) => <Icon {...p}><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></Icon>;
const IconArrowRight = (p) => <Icon {...p}><line x1="5" y1="12" x2="19" y2="12"/><polyline points="12 5 19 12 12 19"/></Icon>;
const IconArrowDown  = (p) => <Icon {...p}><line x1="12" y1="5" x2="12" y2="19"/><polyline points="19 12 12 19 5 12"/></Icon>;
const IconChevron    = (p) => <Icon {...p}><polyline points="6 9 12 15 18 9"/></Icon>;
const IconUsers      = (p) => <Icon {...p}><path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M23 21v-2a4 4 0 0 0-3-3.87"/><path d="M16 3.13a4 4 0 0 1 0 7.75"/></Icon>;
const IconAlert      = (p) => <Icon {...p}><circle cx="12" cy="12" r="10"/><line x1="12" y1="8" x2="12" y2="12"/><line x1="12" y1="16" x2="12.01" y2="16"/></Icon>;
const IconFile       = (p) => <Icon {...p}><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="9" y1="13" x2="15" y2="13"/><line x1="9" y1="17" x2="13" y2="17"/></Icon>;
const IconRefresh    = (p) => <Icon {...p}><polyline points="23 4 23 10 17 10"/><polyline points="1 20 1 14 7 14"/><path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"/></Icon>;
const IconWifi       = (p) => <Icon {...p}><path d="M5 12.55a11 11 0 0 1 14 0"/><path d="M1.42 9a16 16 0 0 1 21.16 0"/><path d="M8.53 16.11a6 6 0 0 1 6.95 0"/><line x1="12" y1="20" x2="12.01" y2="20"/></Icon>;
const IconDownload   = (p) => <Icon {...p}><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></Icon>;
const IconUpload     = (p) => <Icon {...p}><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="17 8 12 3 7 8"/><line x1="12" y1="3" x2="12" y2="15"/></Icon>;
const IconLayers     = (p) => <Icon {...p}><polygon points="12 2 2 7 12 12 22 7 12 2"/><polyline points="2 17 12 22 22 17"/><polyline points="2 12 12 17 22 12"/></Icon>;
const IconLink       = (p) => <Icon {...p}><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></Icon>;
const IconQuote      = (p) => <Icon {...p}><path d="M3 21c3 0 7-1 7-8V5c0-1.25-.75-2-2-2H4c-1.25 0-2 .75-2 2v6c0 1.25.75 2 2 2h2v3c0 2-1 3-3 3z"/><path d="M15 21c3 0 7-1 7-8V5c0-1.25-.75-2-2-2h-4c-1.25 0-2 .75-2 2v6c0 1.25.75 2 2 2h2v3c0 2-1 3-3 3z"/></Icon>;
const IconMenu       = (p) => <Icon {...p}><line x1="3" y1="6" x2="21" y2="6"/><line x1="3" y1="12" x2="21" y2="12"/><line x1="3" y1="18" x2="21" y2="18"/></Icon>;
const IconLinkedIn   = (p) => <Icon {...p} fill="currentColor" stroke="none"><path d="M4.98 3.5C4.98 4.88 3.87 6 2.5 6S0 4.88 0 3.5C0 2.12 1.12 1 2.5 1s2.48 1.12 2.48 2.5zM5 8H0v16h5V8zm7.98 0H8.04v16H13v-8.4c0-4.66 6-5 6 0V24h5V13.74c0-7.95-9-7.66-11.02-3.74V8z"/></Icon>;

// Industry icons -- simple line glyphs in lucide style
const IconHardHat = (p) => <Icon {...p}><path d="M3 18h18"/><path d="M3 18a9 9 0 0 1 18 0"/><path d="M9 9v5"/><path d="M15 9v5"/><path d="M9 9c0-2 1-4 3-4s3 2 3 4"/></Icon>;
const IconPickaxe = (p) => <Icon {...p}><path d="M14 4l6 6"/><path d="M3 21l8.5-8.5"/><path d="M14 4a8 8 0 0 1 6 6l-3 3-6-6 3-3z"/><path d="M11 13l-3 3"/></Icon>;
const IconFactory = (p) => <Icon {...p}><path d="M3 21V11l5 3V11l5 3V11l5 3v7H3z"/><path d="M7 21v-4"/><path d="M12 21v-4"/><path d="M17 21v-4"/></Icon>;
const IconWheat   = (p) => <Icon {...p}><path d="M12 22V8"/><path d="M12 14c-2-1-4-3-4-6 2 0 4 2 4 6z"/><path d="M12 14c2-1 4-3 4-6-2 0-4 2-4 6z"/><path d="M12 10c-2-1-4-3-4-6 2 0 4 2 4 6z"/><path d="M12 10c2-1 4-3 4-6-2 0-4 2-4 6z"/></Icon>;
const IconWarehouse = (p) => <Icon {...p}><path d="M3 21V9l9-5 9 5v12"/><path d="M3 21h18"/><path d="M7 21v-7h10v7"/><path d="M7 17h10"/></Icon>;
const IconTruck   = (p) => <Icon {...p}><rect x="1" y="6" width="13" height="11" rx="1"/><path d="M14 9h4l3 4v4h-7z"/><circle cx="6" cy="19" r="2"/><circle cx="18" cy="19" r="2"/></Icon>;

// Expose to window so other Babel scripts can use them
Object.assign(window, {
  Icon,
  IconClock, IconShield, IconLock, IconScale, IconMapPin, IconScan,
  IconTablet, IconCheck, IconX, IconArrowRight, IconArrowDown, IconChevron,
  IconUsers, IconAlert, IconFile, IconRefresh, IconWifi, IconDownload, IconUpload,
  IconLayers, IconLink, IconQuote, IconMenu, IconLinkedIn,
  IconHardHat, IconPickaxe, IconFactory, IconWheat, IconWarehouse, IconTruck
});
