Skip to content

Commit

Permalink
feat: Show "sleeping" icon on emtpy results
Browse files Browse the repository at this point in the history
  • Loading branch information
codablock committed Aug 17, 2023
1 parent a47ef65 commit 8d5b7bf
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { CommandResultSummary, ValidateResult } from "../../models";
import { Box, Tooltip, Typography } from "@mui/material";
import React from "react";
import { AddedIcon, ChangedIcon, ErrorIcon, OrphanIcon, TrashIcon, WarningIcon } from "../../icons/Icons";
import { Hotel } from "@mui/icons-material";

export interface StatusLineProps {
errors?: number
Expand Down Expand Up @@ -49,6 +50,17 @@ export const StatusLine = (props: StatusLineProps) => {
}

export const CommandResultStatusLine = (props: { rs: CommandResultSummary }) => {
if (!props.rs.errors?.length &&
!props.rs.warnings?.length &&
!props.rs.changedObjects &&
!props.rs.newObjects &&
!props.rs.deletedObjects &&
!props.rs.orphanObjects
) {
return <Tooltip title={"Result is empty"}>
<Hotel/>
</Tooltip>
}
return <StatusLine errors={props.rs.errors?.length}
warnings={props.rs.warnings?.length}
changedObjects={props.rs.changedObjects}
Expand Down

0 comments on commit 8d5b7bf

Please sign in to comment.