diff --git a/apps/console/src/pages/FrameworkListPage.tsx b/apps/console/src/pages/FrameworkListPage.tsx index fbc4576f0..906bda38d 100644 --- a/apps/console/src/pages/FrameworkListPage.tsx +++ b/apps/console/src/pages/FrameworkListPage.tsx @@ -5,12 +5,11 @@ import { usePreloadedQuery, useQueryLoader, } from "react-relay"; -import { Globe2, CheckCircle } from "lucide-react"; import { Card, CardContent } from "@/components/ui/card"; -import { Badge } from "@/components/ui/badge"; import { Link } from "react-router"; import type { FrameworkListPageQuery as FrameworkListPageQueryType } from "./__generated__/FrameworkListPageQuery.graphql"; import { Helmet } from "react-helmet-async"; + const FrameworkListPageQuery = graphql` query FrameworkListPageQuery { node(id: "AZSfP_xAcAC5IAAAAAAltA") { @@ -40,6 +39,49 @@ const FrameworkListPageQuery = graphql` } `; +function FrameworkCard({ + title, + description, + icon, + status, + progress, +}: { + title: string; + description: string; + icon: React.ReactNode; + status?: string; + progress?: string; +}) { + return ( + +
+
+ {icon} +
+ +
+
+

{title}

+ {status && ( + + {status} + + )} +
+

{description}

+
+ + {progress && ( +
+ + {progress} +
+ )} +
+
+ ); +} + function FrameworkListPageContent({ queryRef, }: { @@ -50,50 +92,40 @@ function FrameworkListPageContent({ data.node.frameworks?.edges.map((edge) => edge?.node) ?? []; return ( -
-
-

Framework

-

- Compliance frameworks like SOC 2 and ISO 27001 provide guidelines to - secure sensitive data, manage risks, and build trust. SOC 2 focuses on - customer data protection via five Trust Principles, while ISO 27001 - establishes a comprehensive Information Security Management System for - global standards. -

+
+
+

Framework

-
- {frameworks.map((framework) => ( - - - -
- - Active - -
- -
- {framework?.name} -
+
+ {frameworks.map((framework) => { + const validatedControls = framework.controls.edges.filter( + edge => edge?.node?.state === "IMPLEMENTED" + ).length; + const totalControls = framework.controls.edges.length; + + return ( + + + + {framework.name.split(' ')[0]} +
-

- {framework?.name} -

-

- {framework?.description} -

-
-
-
- - {framework?.controls?.edges.length} Controls -
-
- - - - ))} + } + status={validatedControls === totalControls ? "Compliant" : undefined} + progress={ + validatedControls === totalControls + ? "All controls validated" + : `${validatedControls}/${totalControls} Controls validated` + } + /> + + ); + })}
);