import { memo } from 'react'; import { useTranslation } from 'react-i18next'; import { Button, Popover, Space, Tag, Tooltip } from 'antd'; import { DeleteOutlined, EditOutlined, InfoCircleOutlined, QrcodeOutlined, RetweetOutlined, } from '@ant-design/icons'; import { formatInboundLabel } from '@/lib/inbounds/label'; import type { InboundOption } from '@/hooks/useClients'; const ICON_BUTTON_STYLE = { fontSize: 16 } as const; interface ClientRowActionsProps { email: string; onShowQr: (email: string) => void; onShowInfo: (email: string) => void; onResetTraffic: (email: string) => void; onEdit: (email: string) => void; onDelete: (email: string) => void; } // Five Tooltip-wrapped buttons per row, none of which depend on traffic. Left // inline they re-ran rc-tooltip's alignment machinery for every visible row on // every traffic push — 125 Tooltips on a 25-row page, five seconds apart. // Keyed on the email rather than the row object, because a push replaces the row // object of every client whose counters moved; the page resolves the live row. export const ClientRowActions = memo(function ClientRowActions({ email, onShowQr, onShowInfo, onResetTraffic, onEdit, onDelete, }: ClientRowActionsProps) { const { t } = useTranslation(); return (