// KW Birlik Cockpit — icons + small atoms

const Icon = ({ name, size = 18, className = '' }) => {
  const props = { width: size, height: size, viewBox: '0 0 24 24', fill: 'none', stroke: 'currentColor', strokeWidth: 1.6, strokeLinecap: 'round', strokeLinejoin: 'round', className };
  switch (name) {
    case 'home':     return <svg {...props}><path d="M3 11.5 12 4l9 7.5"/><path d="M5 10v9a1 1 0 0 0 1 1h4v-6h4v6h4a1 1 0 0 0 1-1v-9"/></svg>;
    case 'chat':     return <svg {...props}><path d="M21 12a8 8 0 0 1-11.5 7.2L4 21l1.8-5.5A8 8 0 1 1 21 12Z"/></svg>;
    case 'team':     return <svg {...props}><circle cx="9" cy="8" r="3.2"/><path d="M3.5 19a5.5 5.5 0 0 1 11 0"/><circle cx="17" cy="9" r="2.6"/><path d="M15 19a4.5 4.5 0 0 1 6.5-4"/></svg>;
    case 'news':     return <svg {...props}><rect x="3" y="4" width="18" height="16" rx="2"/><path d="M7 8h10M7 12h10M7 16h6"/></svg>;
    case 'meetings': return <svg {...props}><rect x="3" y="5" width="18" height="15" rx="2"/><path d="M3 9h18M8 3v4M16 3v4"/></svg>;
    case 'tasks':    return <svg {...props}><rect x="4" y="4" width="16" height="16" rx="3"/><path d="m8.5 12.5 2.3 2.3 4.7-5"/></svg>;
    case 'data':     return <svg {...props}><path d="M4 19V5M4 19h16"/><rect x="8" y="11" width="3" height="6"/><rect x="13" y="7" width="3" height="10"/><rect x="18" y="14" width="0" height="3"/></svg>;
    case 'files':    return <svg {...props}><path d="M3 7a2 2 0 0 1 2-2h4l2 2.5h8a2 2 0 0 1 2 2V18a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/><path d="M3 10h18"/></svg>;
    case 'analytics':return <svg {...props}><path d="M4 19V5M4 19h16"/><path d="m6 15 4-4 3 2 5-6"/><circle cx="6" cy="15" r="1.2"/><circle cx="10" cy="11" r="1.2"/><circle cx="13" cy="13" r="1.2"/><circle cx="18" cy="7" r="1.2"/></svg>;
    case 'settings': return <svg {...props}><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 0 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 0 1-4 0v-.1a1.7 1.7 0 0 0-1.1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 0 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 0 1 0-4h.1a1.7 1.7 0 0 0 1.5-1.1 1.7 1.7 0 0 0-.3-1.8L4.2 6a2 2 0 0 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V2a2 2 0 0 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 0 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9a1.7 1.7 0 0 0 1.5 1H21a2 2 0 0 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1Z"/></svg>;
    case 'search':   return <svg {...props}><circle cx="11" cy="11" r="7"/><path d="m20 20-3.5-3.5"/></svg>;
    case 'mic':      return <svg {...props}><rect x="9" y="3" width="6" height="12" rx="3"/><path d="M5 11a7 7 0 0 0 14 0M12 18v3"/></svg>;
    case 'send':     return <svg {...props} strokeWidth="2"><path d="M5 12h14M13 6l6 6-6 6"/></svg>;
    case 'arrow-up': return <svg {...props} strokeWidth="2.2"><path d="M12 19V5M5 12l7-7 7 7"/></svg>;
    case 'chevron':  return <svg {...props}><path d="m9 6 6 6-6 6"/></svg>;
    case 'chevron-d':return <svg {...props}><path d="m6 9 6 6 6-6"/></svg>;
    case 'sparkle':  return <svg {...props} strokeWidth="1.8"><path d="M12 3v3M12 18v3M3 12h3M18 12h3M5.6 5.6l2.1 2.1M16.3 16.3l2.1 2.1M5.6 18.4l2.1-2.1M16.3 7.7l2.1-2.1"/></svg>;
    case 'globe':    return <svg {...props}><circle cx="12" cy="12" r="9"/><path d="M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18"/></svg>;
    case 'pin':      return <svg {...props}><path d="M12 22s7-6 7-12a7 7 0 1 0-14 0c0 6 7 12 7 12z"/><circle cx="12" cy="10" r="2.5"/></svg>;
    case 'lightbulb':return <svg {...props}><path d="M9 18h6M10 22h4M12 2a7 7 0 0 0-4 12c1 1 1.5 2 1.5 3h5c0-1 .5-2 1.5-3a7 7 0 0 0-4-12z"/></svg>;
    case 'group':    return <svg {...props}><circle cx="9" cy="8" r="3"/><circle cx="17" cy="9" r="2.4"/><path d="M3 19a6 6 0 0 1 12 0M14 19a5 5 0 0 1 7-3"/></svg>;
    case 'x':        return <svg {...props} strokeWidth="2"><path d="M6 6l12 12M18 6 6 18"/></svg>;
    case 'check':    return <svg {...props} strokeWidth="2.2"><path d="m5 12 4.5 4.5L19 7"/></svg>;
    case 'plus':     return <svg {...props} strokeWidth="2"><path d="M12 5v14M5 12h14"/></svg>;
    case 'sun':      return <svg {...props}><circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"/></svg>;
    case 'moon':     return <svg {...props}><path d="M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z"/></svg>;
    case 'external': return <svg {...props}><path d="M9 5h10v10"/><path d="M19 5 9 15"/><path d="M15 13v6H5V9h6"/></svg>;
    case 'bookmark': return <svg {...props}><path d="M6 4h12v17l-6-4-6 4z"/></svg>;
    case 'arrow-back': return <svg {...props} strokeWidth="2"><path d="M19 12H5M12 19l-7-7 7-7"/></svg>;
    case 'filter':   return <svg {...props}><path d="M3 5h18l-7 9v6l-4-2v-4z"/></svg>;
    default: return null;
  }
};

window.Icon = Icon;
