import React from 'react' import { Skeleton } from '../../molecules/Skeleton' import { getPlatformIcon, prioritizeCurrentDevice } from './helpers' import { Divider, Text } from '../../atoms' import { getGlobalStyle } from '../../../utils' import styles from './styles.module.css' /** * Device interface aligned with backend GraphQL schema */ interface Device { dId: string deviceId: string deviceName: string platform: string shortName?: string | null locationFormat?: string | null family?: string | null os?: string | null model?: string | null ip?: string | null isBot?: boolean | null dState: number userId: string locationFormation?: string | null createdAt: string updatedAt: string } interface IDevicesProps { data: Device[] deviceId: string | null loading: boolean } /** * Format date into a human-readable string * @param {string} date - ISO date string * @returns {string} Formatted date */ const formatDate = (date: string): string => { try { return new Intl.DateTimeFormat('es-ES', { dateStyle: 'short', timeStyle: 'short' }).format(new Date(date)) } catch { return date } } /** * DeviceCard component to display a single device * @param {Device} device - Device object * @param {string | null} currentDeviceId - ID of current device * @returns {JSX.Element} Rendered device card */ const DeviceCard: React.FC<{ device: Device, currentDeviceId: string | null }> = ({ device, currentDeviceId }) => (