import { Box, Button } from '@rocket.chat/fuselage'; import { useMediaQuery } from '@rocket.chat/fuselage-hooks'; import { GenericTableCell, GenericTableRow } from '@rocket.chat/ui-client'; import { useTranslation } from 'react-i18next'; import DeviceIcon from '../../../../components/deviceManagement/DeviceIcon'; import { useDeviceLogout } from '../../../../hooks/useDeviceLogout'; import { useFormatDateAndTime } from '../../../../hooks/useFormatDateAndTime'; type DevicesRowProps = { _id: string; deviceName?: string; deviceType?: string; deviceOSName?: string; loginAt: string; current?: boolean; }; const DeviceManagementAccountRow = ({ _id, deviceName, deviceType = 'browser', deviceOSName, loginAt, current }: DevicesRowProps) => { const { t } = useTranslation(); const formatDateAndTime = useFormatDateAndTime(); const mediaQuery = useMediaQuery('(min-width: 1024px)'); const handleDeviceLogout = useDeviceLogout(_id, '/v1/sessions/logout.me', current); return ( {deviceName && ( {deviceName} {current && ` (${t('current')})`} )} {deviceOSName || ''} {formatDateAndTime(loginAt)} {mediaQuery && {_id}} ); }; export default DeviceManagementAccountRow;