fix: active sessions icons and delete button
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user