@@ -6,19 +6,7 @@ import {
|
|||||||
usePreloadedQuery,
|
usePreloadedQuery,
|
||||||
useQueryLoader,
|
useQueryLoader,
|
||||||
} from "react-relay";
|
} from "react-relay";
|
||||||
import {
|
import { Shield, FileText, Clock } from "lucide-react";
|
||||||
Building2,
|
|
||||||
Computer,
|
|
||||||
Mail,
|
|
||||||
Shield,
|
|
||||||
Network,
|
|
||||||
Database,
|
|
||||||
FileText,
|
|
||||||
Share2,
|
|
||||||
AlertTriangle,
|
|
||||||
Users,
|
|
||||||
Clock,
|
|
||||||
} from "lucide-react";
|
|
||||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||||
import { Progress } from "@/components/ui/progress";
|
import { Progress } from "@/components/ui/progress";
|
||||||
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
|
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
|
||||||
@@ -58,21 +46,26 @@ function FrameworkOverviewPageContent({
|
|||||||
const controls = framework.controls?.edges.map((edge) => edge?.node) ?? [];
|
const controls = framework.controls?.edges.map((edge) => edge?.node) ?? [];
|
||||||
|
|
||||||
// Group controls by their category
|
// Group controls by their category
|
||||||
const controlsByCategory = controls.reduce((acc, control) => {
|
const controlsByCategory = controls.reduce(
|
||||||
if (!control?.category) return acc;
|
(acc, control) => {
|
||||||
if (!acc[control.category]) {
|
if (!control?.category) return acc;
|
||||||
acc[control.category] = [];
|
if (!acc[control.category]) {
|
||||||
}
|
acc[control.category] = [];
|
||||||
acc[control.category].push(control);
|
}
|
||||||
return acc;
|
acc[control.category].push(control);
|
||||||
}, {} as Record<string, typeof controls>);
|
return acc;
|
||||||
|
},
|
||||||
|
{} as Record<string, typeof controls>,
|
||||||
|
);
|
||||||
|
|
||||||
const controlCards = Object.entries(controlsByCategory).map(([category, controls]) => ({
|
const controlCards = Object.entries(controlsByCategory).map(
|
||||||
title: category,
|
([category, controls]) => ({
|
||||||
controls,
|
title: category,
|
||||||
completed: controls.filter((c) => c?.state === "IMPLEMENTED").length,
|
controls,
|
||||||
total: controls.length,
|
completed: controls.filter((c) => c?.state === "IMPLEMENTED").length,
|
||||||
}));
|
total: controls.length,
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
|
||||||
const totalImplemented = controls.filter(
|
const totalImplemented = controls.filter(
|
||||||
(c) => c?.state === "IMPLEMENTED",
|
(c) => c?.state === "IMPLEMENTED",
|
||||||
|
|||||||
Reference in New Issue
Block a user