| 1 | import React from "react"; |
| 2 | |
| 3 | |
| 4 | |
| 5 | export function AgentIcon({ accountNumber, size = 20 }) { |
| 6 | const number = Number.isInteger(accountNumber) && accountNumber > 0 ? String(accountNumber) : ""; |
| 7 | return <svg className="agent-icon" width={size} height={size} viewBox="0 0 24 24" |
| 8 | fill="none" stroke="currentColor" strokeWidth="1.75" strokeLinecap="round" strokeLinejoin="round" |
| 9 | role="img" aria-label={number ? `Agent · 账号 ${number}` : "Agent"}> |
| 10 | <path d="M12 3v3M2 11v5m20-5v5" /> |
| 11 | <rect x="4" y="6" width="16" height="15" rx="4" /> |
| 12 | {number ? <text x="12" y="14" dominantBaseline="central" textAnchor="middle" |
| 13 | fill="currentColor" stroke="none" fontFamily="var(--ui-font-family, system-ui, sans-serif)" |
| 14 | fontSize={number.length === 1 ? 12 : number.length === 2 ? 10 : 8} fontWeight="700" |
| 15 | {...(number.length > 2 ? { textLength: 13, lengthAdjust: "spacingAndGlyphs" } : {})}>{number}</text> |
| 16 | : <><path d="M8.5 11v2m7-2v2M9 17h6" /></>} |
| 17 | </svg>; |
| 18 | } |