Fix compliance update display

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
Sacha Al Himdani
2026-03-11 18:26:54 +01:00
parent 5e75dd7f91
commit 5372404a12
2 changed files with 22 additions and 8 deletions

View File

@@ -16,6 +16,7 @@ export function MainSkeleton() {
<TabLink to={getTrustCenterUrl("subprocessors")}> <TabLink to={getTrustCenterUrl("subprocessors")}>
{__("Subprocessors")} {__("Subprocessors")}
</TabLink> </TabLink>
<TabLink to={getTrustCenterUrl("updates")}>{__("Updates")}</TabLink>
</Tabs> </Tabs>
<TabSkeleton /> <TabSkeleton />
</main> </main>

View File

@@ -4,6 +4,7 @@ import { useState } from "react";
import { type PreloadedQuery, usePreloadedQuery } from "react-relay"; import { type PreloadedQuery, usePreloadedQuery } from "react-relay";
import { graphql } from "relay-runtime"; import { graphql } from "relay-runtime";
import { Rows } from "#/components/Rows";
import type { UpdatesPageQuery } from "#/pages/__generated__/UpdatesPageQuery.graphql"; import type { UpdatesPageQuery } from "#/pages/__generated__/UpdatesPageQuery.graphql";
export const currentTrustUpdatesQuery = graphql` export const currentTrustUpdatesQuery = graphql`
@@ -41,14 +42,26 @@ export function UpdatesPage({ queryRef }: Props) {
return ( return (
<div> <div>
<h2 className="font-medium mb-1">{__("Updates")}</h2> <h2 className="font-medium mb-1">{__("Updates")}</h2>
<p className="text-sm text-txt-secondary mb-4"> {items.length === 0
{__("Latest compliance and security updates:")} ? (
</p> <Rows>
<div className="space-y-0"> <div className="text-sm text-txt-tertiary text-center py-5">
{items.map(item => ( {__("No updates have been published yet.")}
<UpdateItem key={item.id} item={item} /> </div>
))} </Rows>
</div> )
: (
<>
<p className="text-sm text-txt-secondary mb-4">
{__("Latest compliance and security updates")}
</p>
<div className="space-y-0">
{items.map(item => (
<UpdateItem key={item.id} item={item} />
))}
</div>
</>
)}
</div> </div>
); );
} }