fix: active sessions icons and delete button

This commit is contained in:
Sajad Mirjalili
2025-09-29 17:57:54 +03:30
parent 8808d9bdb1
commit 6f96198c53
2 changed files with 12 additions and 5 deletions

View File

@@ -7,7 +7,7 @@ import {
Stack,
} from '@mui/material';
import { useTranslation } from 'react-i18next';
import { DeviceMessage, Logout } from 'iconsax-react';
import { DeviceMessage, Logout, Mobile } from 'iconsax-react';
import { CardContainer } from '@/components/CardContainer';
import { PageWrapper } from '../components/PageWrapper';
import { Icon } from '@rkheftan/harmony-ui';
@@ -43,7 +43,8 @@ export function ActiveDevicesPage() {
const formattedDevices = sessions.map((session: ApiSession) => ({
id: session.key,
timeAndDate: formatDate(session.created, i18n.language, t),
deviceModel: `${session.deviceOs} ${session.deviceName}`,
deviceOs: session.deviceOs,
deviceName: session.deviceName,
ip: session.ipAddress,
current: session.key === currentKey,
}));
@@ -199,12 +200,16 @@ export function ActiveDevicesPage() {
}}
>
<Icon
Component={DeviceMessage}
Component={
device.deviceName === 'smartphone'
? Mobile
: DeviceMessage
}
size="medium"
color="primary.main"
/>
<Typography variant="body2" noWrap>
{device.deviceModel}
{`${device.deviceOs} ${device.deviceName}`}
</Typography>
</Box>
@@ -253,6 +258,7 @@ export function ActiveDevicesPage() {
}
loading={loadingDeleteIds.includes(device.id)}
onClick={() => handleDeleteDevice(device.id)}
fullWidth={false}
sx={{
color: 'error.main',
borderRadius: 1,

View File

@@ -19,7 +19,8 @@ export interface InfoRowData {
export interface Device {
id: string;
timeAndDate: string;
deviceModel: string;
deviceName: 'smartphone' | 'desktop' | string;
deviceOs: string;
ip: string;
current: boolean;
}