Skip to content

Commit

Permalink
Allocated devices empty state (#1656)
Browse files Browse the repository at this point in the history
Empty state added for allocated devices
  • Loading branch information
Shruti-Apte authored Feb 16, 2024
1 parent bf8fc89 commit c88725e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import React, { Fragment } from "react";

import { MobileIcon } from "miruIcons";

import EmptyStates from "common/EmptyStates";

const StaticPage = ({ devices }) => {
const DeviceDetails = ({ device }) => {
const {
Expand Down Expand Up @@ -75,9 +77,17 @@ const StaticPage = ({ devices }) => {

return (
<Fragment>
{devices?.map((device, index) => (
<DeviceDetails device={device} key={index} />
))}
{devices.length > 0 ? (
devices.map((device, index) => (
<DeviceDetails device={device} key={index} />
))
) : (
<EmptyStates
Message="No devices found"
containerClassName="h-full"
showNoSearchResultState={false}
/>
)}
</Fragment>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,15 @@ const AllocatedDevicesDetails = () => {

return (
<Fragment>
{isDesktop && (
{isDesktop ? (
<DetailsHeader
showButtons
editAction={handleEdit}
isDisableUpdateBtn={false}
showButtons={false}
subTitle=""
title="Allocated Devices"
/>
)}
{!isDesktop && (
) : (
<MobileEditHeader
backHref="/settings/"
href="/settings/devices/edit"
Expand Down

0 comments on commit c88725e

Please sign in to comment.