From a7c7a58fcc5c0c31d500ae2a04d12b189405f3d8 Mon Sep 17 00:00:00 2001 From: dyzulk <66510723+dyzulk@users.noreply.github.com> Date: Wed, 7 Jan 2026 11:53:20 +0700 Subject: [PATCH] feat: implement public ca relevancy (only latest & hierarchical) --- src/app/(public)/HomeClient.tsx | 59 ++++++++++++++++++++------------- 1 file changed, 36 insertions(+), 23 deletions(-) diff --git a/src/app/(public)/HomeClient.tsx b/src/app/(public)/HomeClient.tsx index a7ca85b..f586cc7 100644 --- a/src/app/(public)/HomeClient.tsx +++ b/src/app/(public)/HomeClient.tsx @@ -559,31 +559,44 @@ export default function HomeClient() {
) : ( -
- {/* Root CA Section */} -
-

- {t('root_ca_hierarchy')} -

-
- {certificates.filter(c => c.type === 'root').map((cert) => ( - - ))} -
-
+
+ {Object.entries( + certificates.reduce((acc, cert) => { + const famId = cert.family_id || 'unknown'; + if (!acc[famId]) acc[famId] = []; + acc[famId].push(cert); + return acc; + }, {} as Record) + ).map(([famId, familyCerts]) => ( +
+ {/* Root Section of the Family */} +
+

+ {t('root_ca_hierarchy')} +

+
+ {familyCerts.filter(c => c.type === 'root').map((cert) => ( + + ))} +
+
- {/* Intermediate CAs Section */} -
-
-

- {t('intermediate_ca_hierarchy')} -

-
- {certificates.filter(c => c.type !== 'root').map((cert) => ( - - ))} + {/* Connecting Line */} +
+ + {/* Intermediates Section of the Family */} +
+

+ {t('intermediate_ca_hierarchy')} +

+
+ {familyCerts.filter(c => c.type !== 'root').map((cert) => ( + + ))} +
+
-
+ ))} {/* OS Selection Tabs for Global Guide */}