@@ -6,14 +6,14 @@ import type { Organization, Policy, Task } from '@comp/db/types';
66
77interface ComplianceReportProps {
88 organization : Organization ;
9- policies : Policy [ ] ;
10- controls : Task [ ] ;
9+ policies : Pick < Policy , "id" | "name" | "status" > [ ] ;
10+ controls : Pick < Task , "id" | "title" | "status" > [ ] ;
1111}
1212
1313export default function ComplianceReport ( { organization, policies, controls } : ComplianceReportProps ) {
1414 return (
15- < div className = "min-h-screen" >
16- < div className = "max-w-6xl mx-auto p-6 " >
15+ < div >
16+ < div className = "max-w-6xl mx-auto" >
1717 < div className = "rounded-lg" >
1818 < div >
1919 < ComplianceHeader
@@ -22,30 +22,31 @@ export default function ComplianceReport({ organization, policies, controls }: C
2222 />
2323
2424 < ComplianceSummary
25- text = { `${ organization . name } is using Comp AI to monitor their compliance against frameworks like SOC 2, ISO 27001, and more.` }
25+ text = { `${ organization . name } is using Comp AI to monitor their compliance against common cybersecurity frameworks like SOC 2, ISO 27001, and more.` }
2626 />
27-
28- < div className = "border-b mt-4" />
2927 </ div >
3028
3129 < div className = "grid grid-cols-1 md:grid-cols-2 gap-4 mt-4" >
32- < ComplianceSection title = "Policies" isLive >
33- < div className = "space-y-2" >
34- { policies . map ( ( policy ) => (
35- < ComplianceItem key = { policy . id } text = { policy . name } isCompliant = { policy . status === "published" } />
36- ) ) }
37- </ div >
38- </ ComplianceSection >
30+ { policies . length > 0 && (
31+ < ComplianceSection title = "Policies" isLive >
32+ < div className = "space-y-2" >
33+ { policies . map ( ( policy ) => (
34+ < ComplianceItem key = { policy . id } text = { policy . name } isCompliant = { policy . status === "published" } />
35+ ) ) }
36+ </ div >
37+ </ ComplianceSection >
38+ ) }
3939
40- < ComplianceSection title = "Controls" isLive >
41- < div className = "space-y-2" >
42- { controls . map ( ( control ) => (
43- < ComplianceItem key = { control . id } text = { control . title } isCompliant = { control . status === "done" } />
44- ) ) }
45- </ div >
46- </ ComplianceSection >
40+ { controls . length > 0 && (
41+ < ComplianceSection title = "Controls" isLive >
42+ < div className = "space-y-2" >
43+ { controls . map ( ( control ) => (
44+ < ComplianceItem key = { control . id } text = { control . title } isCompliant = { control . status === "done" } />
45+ ) ) }
46+ </ div >
47+ </ ComplianceSection >
48+ ) }
4749 </ div >
48-
4950 </ div >
5051 </ div >
5152 </ div >
0 commit comments