-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: move self topology status to subtitle
- Loading branch information
1 parent
00bce64
commit 05193c9
Showing
4 changed files
with
57 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/components/Topology/TopologyCard/TopologyItemHealthSummary.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { Topology } from "@flanksource-ui/api/types/topology"; | ||
import { StatusLine } from "@flanksource-ui/components/StatusLine/StatusLine"; | ||
import { useMemo } from "react"; | ||
import { getTopologyHealthSummary } from "./TopologCardStatuses"; | ||
|
||
type TopologyItemHealthSummaryProps = { | ||
topology: Topology; | ||
}; | ||
|
||
export default function TopologyItemHealthSummary({ | ||
topology | ||
}: TopologyItemHealthSummaryProps) { | ||
const statusLines = useMemo(() => { | ||
return getTopologyHealthSummary(topology, "individual_level"); | ||
}, [topology]); | ||
|
||
if (!statusLines || statusLines.statuses.length === 0) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<div className="flex flex-col gap-1"> | ||
<StatusLine {...statusLines} hideName /> | ||
</div> | ||
); | ||
} |