From 1bdd8f51fb90ab62157d8910996529eb310a3491 Mon Sep 17 00:00:00 2001
From: dyzulk <66510723+dyzulk@users.noreply.github.com>
Date: Thu, 8 Jan 2026 13:02:20 +0700
Subject: [PATCH] Fix: TS error and Feat: Add multi-distro support
---
src/app/(public)/HomeClient.tsx | 77 ++++++++++++++++++++++++++++-----
1 file changed, 67 insertions(+), 10 deletions(-)
diff --git a/src/app/(public)/HomeClient.tsx b/src/app/(public)/HomeClient.tsx
index b8ef9df..2049de1 100644
--- a/src/app/(public)/HomeClient.tsx
+++ b/src/app/(public)/HomeClient.tsx
@@ -128,7 +128,7 @@ function CliSnippet({ label, command, t }: { label: string, command: string, t:
);
}
-function OsGuideContent({ title, steps, selectedOs, certificates, t }: { title: string, steps: string[], selectedOs: string, certificates: CaCertificate[], t: any }) {
+function OsGuideContent({ title, steps, selectedOs, certificates, t, linuxDistro, setLinuxDistro }: { title: string, steps: string[], selectedOs: string, certificates: CaCertificate[], t: any, linuxDistro?: string, setLinuxDistro?: (distro: any) => void }) {
return (
@@ -171,11 +171,43 @@ function OsGuideContent({ title, steps, selectedOs, certificates, t }: { title:
{(selectedOs === 'linux' || selectedOs === 'windows' || selectedOs === 'macos') && (
{(selectedOs === 'linux') && (
-
+
+
+
+
+
+
+
+
+ {linuxDistro === 'debian' && (
+
+ )}
+ {linuxDistro === 'rhel' && (
+
+ )}
+ {linuxDistro === 'arch' && (
+
+ )}
+ {linuxDistro === 'other' && (
+
+ )}
+
)}
{(selectedOs === 'windows' || selectedOs === 'macos') && (
@@ -232,7 +264,7 @@ function OsGuideContent({ title, steps, selectedOs, certificates, t }: { title:
);
}
-function CaCard({ cert, isRoot, t, selectedOs, setSelectedOs }: { cert: CaCertificate, isRoot: boolean, t: any, selectedOs: string, setSelectedOs: (os: any) => void }) {
+function CaCard({ cert, isRoot, t, selectedOs, setSelectedOs, linuxDistro, setLinuxDistro }: { cert: CaCertificate, isRoot: boolean, t: any, selectedOs: string, setSelectedOs: (os: any) => void, linuxDistro?: string, setLinuxDistro?: (distro: any) => void }) {
return (
{/* Sync Status Badge */}
@@ -310,6 +342,30 @@ function CaCard({ cert, isRoot, t, selectedOs, setSelectedOs }: { cert: CaCertif
variant="gray"
isFullWidth
/>
+
+ {selectedOs === 'linux' && setLinuxDistro && (
+
+
+
+
+
+
+
+
+ {linuxDistro === 'debian' && (
+
+ )}
+ {linuxDistro === 'rhel' && (
+
+ )}
+ {linuxDistro === 'arch' && (
+
+ )}
+ {linuxDistro === 'other' && (
+
+ )}
+
+ )}
)}
@@ -392,6 +448,7 @@ export default function HomeClient() {
const [certificates, setCertificates] = useState
([]);
const [loadingCerts, setLoadingCerts] = useState(true);
const [selectedOs, setSelectedOs] = useState<'windows' | 'macos' | 'linux' | 'mobile'>('windows');
+ const [linuxDistro, setLinuxDistro] = useState<'debian' | 'rhel' | 'arch' | 'other'>('debian');
useEffect(() => {
const fetchCertificates = async () => {
@@ -577,7 +634,7 @@ export default function HomeClient() {
{familyCerts.filter(c => c.type === 'root').map((cert) => (
-
+
))}
@@ -592,7 +649,7 @@ export default function HomeClient() {
{familyCerts.filter(c => c.type !== 'root').map((cert) => (
-
+
))}
@@ -616,7 +673,7 @@ export default function HomeClient() {
{selectedOs === 'windows' && }
{selectedOs === 'macos' && }
- {selectedOs === 'linux' && }
+ {selectedOs === 'linux' && }
{selectedOs === 'mobile' && }