diff --git a/pkg/frontend/src/components/CompositeResourcesList.tsx b/pkg/frontend/src/components/CompositeResourcesList.tsx
index 92f0cc9..aba70f3 100644
--- a/pkg/frontend/src/components/CompositeResourcesList.tsx
+++ b/pkg/frontend/src/components/CompositeResourcesList.tsx
@@ -1,4 +1,5 @@
-import {Card, CardContent, Grid} from '@mui/material';
+import {Box, Alert, Stack, List, Card, CardContent, Grid, Accordion, AccordionSummary, AccordionDetails} from '@mui/material';
+import {ExpandMore as ExpandMoreIcon} from '@mui/icons-material';
import {CompositeResource, CompositeResourceExtended, ItemList, K8sReference, K8sResource} from "../types.ts";
import Typography from "@mui/material/Typography";
import ReadySynced from "./ReadySynced.tsx";
@@ -98,13 +99,86 @@ export default function CompositeResourcesList({items}: ItemListProps) {
)
}
+ // Define Grouped Items
+ const groupedItems: { [itemIndex: string]: CompositeResource[] } = {};
+ items.items.forEach((item) => {
+ const itemIndex = item.kind
+ if (!groupedItems[itemIndex]) {
+ groupedItems[itemIndex] = [];
+ }
+ groupedItems[itemIndex].push(item);
+ });
+
+ // Accordion State
+ const [expandedItems, setExpandedItems] = useState<{[itemIndex: string]: boolean}>({});
+ const handleAccordionChange = (itemIndex: string) => {
+ setExpandedItems((prevState) => ({
+ ...prevState,
+ [itemIndex]: !prevState[itemIndex],
+ }));
+ };
+
return (
<>
-
- {items?.items?.map((item: CompositeResource) => (
-
- ))}
-
+ {Object.entries(groupedItems).map(([itemIndex, items]) => (
+
+ handleAccordionChange(itemIndex)}>
+ }>
+
+ {itemIndex}
+
+ *': {
+ py: '4px !important',
+ },}}
+ severity="success">
+ Ready: {items.filter((item) => item.status?.conditions?.find((condition) =>
+ condition.status === "True" && condition.type === "Ready")).length}
+
+
+ {
+ items.filter((item) => !item.status?.conditions?.find((condition) =>
+ condition.status === "True" && condition.type === "Ready")).length > 0 ? (
+
+ *': {
+ py: '4px !important',
+ },}}
+ severity="error" color="warning">
+ Not Ready: {items.filter((item) => !item.status?.conditions?.find((condition) =>
+ condition.status === "True" && condition.type === "Ready")).length}
+
+
+ ) : null
+ }
+ {
+ items.filter((item) => !item.status?.conditions?.find((condition) =>
+ condition.status === "True" && condition.type === "Synced")).length > 0 ? (
+
+ *': {
+ py: '4px !important',
+ },}}
+ severity="info" color="info">
+ Not Synced: {items.filter((item) => !item.status?.conditions?.find((condition) =>
+ condition.status === "True" && condition.type === "Sync")).length}
+
+
+ ) : null
+ }
+
+
+
+
+ {items.map((item: CompositeResource) => (
+
+ ))}
+
+
+
+
+ ))}