import PropTypes from 'prop-types' import React from 'react' import { Skeleton } from '../../molecules/Skeleton' import { getPlatformIcon, prioritizeCurrentDevice } from './helpers' import { CardDevice, ContainerDevices } from './styled' export const Devices = ({ data = [], deviceId = null, loading = false }) => { const prioritizedData = prioritizeCurrentDevice(data, deviceId) if (loading) return ( ) return ( {prioritizedData?.map(x => {return ( {getPlatformIcon(x.platform)}
{x?.deviceName} - {x?.platform} {deviceId === x.deviceId && Current device }
{x?.short_name} {x?.locationFormat} {x?.DatCre}
)})}
) } // Prop types for the Devices component Devices.propTypes = { data: PropTypes.array, deviceId: PropTypes.string, loading: PropTypes.bool } export default Devices