Fix: Text area for devices not found to say no devices (#80011)

* initla commit

linting

make it along the area

* linting
This commit is contained in:
Eric Leijonmarck 2024-01-04 14:04:45 +01:00 committed by GitHub
parent 576b8ccff6
commit 89a3337afa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,7 @@
import React, { useMemo } from 'react'; import React, { useMemo } from 'react';
import { Avatar, CellProps, Column, InteractiveTable, Stack, Badge, Tooltip } from '@grafana/ui'; import { Avatar, CellProps, Column, InteractiveTable, Stack, Badge, Tooltip } from '@grafana/ui';
import { EmptyArea } from 'app/features/alerting/unified/components/EmptyArea';
import { UserAnonymousDeviceDTO } from 'app/types'; import { UserAnonymousDeviceDTO } from 'app/types';
type Cell<T extends keyof UserAnonymousDeviceDTO = keyof UserAnonymousDeviceDTO> = CellProps< type Cell<T extends keyof UserAnonymousDeviceDTO = keyof UserAnonymousDeviceDTO> = CellProps<
@ -86,6 +87,11 @@ export const AnonUsersDevicesTable = ({ devices }: AnonUsersTableProps) => {
return ( return (
<Stack direction={'column'} gap={2}> <Stack direction={'column'} gap={2}>
<InteractiveTable columns={columns} data={devices} getRowId={(user) => user.deviceId} /> <InteractiveTable columns={columns} data={devices} getRowId={(user) => user.deviceId} />
{devices.length === 0 && (
<EmptyArea>
<span>No anonymous users found.</span>
</EmptyArea>
)}
</Stack> </Stack>
); );
}; };