import { Button, Modal, Popconfirm, Tag, Typography } from 'antd'; import { DeleteOutlined, ReloadOutlined } from '@ant-design/icons'; import { useTranslation } from 'react-i18next'; import type { ClientHwidInfo } from '@/lib/clients/hwid-log'; interface ClientHwidListModalProps { open: boolean; email?: string; zIndex?: number; hwids: ClientHwidInfo[]; loading: boolean; clearing: boolean; deletingId: number | null; formatDate: (ts: number) => string; onRefresh: () => void; onClearAll: () => void; onDelete: (id: number) => void; onClose: () => void; } // The single place the HWID device list is rendered — the edit form and the // info card share it so date format and row layout can't drift apart again. export default function ClientHwidListModal({ open, email, zIndex, hwids, loading, clearing, deletingId, formatDate, onRefresh, onClearAll, onDelete, onClose, }: ClientHwidListModalProps) { const { t } = useTranslation(); return ( } loading={loading} onClick={onRefresh} > {t('refresh')} , , , ]} > {hwids.length > 0 ? (
{hwids.map((entry) => (
{entry.deviceModel || entry.userAgent || t('pages.clients.hwidDevice')}
{[entry.deviceOs, entry.osVersion].filter(Boolean).join(' ')}
{t('pages.clients.firstSeen')}: {formatDate(entry.firstSeen)}
{t('pages.clients.lastSeen')}: {formatDate(entry.lastSeen)} {entry.userAgent && ( <>
{entry.userAgent} )} {entry.fingerprint && ( <>
{t('pages.clients.hwidFingerprint')}: {entry.fingerprint} )}
onDelete(entry.id)} okType="danger" okText={t('delete')} cancelText={t('cancel')} >
))}
) : ( {t('pages.clients.noHwids')} )}
); }