fix(ui): hide version badge when API fails instead of showing v5.0.0

HeroSection defaulted to '5.0.0' when version prop was undefined,
causing a misleading version badge when the overview API fails (e.g.,
403 from remote access without auth). Now hides the badge entirely
until a real version is loaded.
This commit is contained in:
Tam Nhu Tran
2026-03-28 21:22:20 -04:00
parent c26efae72a
commit efe6953da0
+6 -4
View File
@@ -5,16 +5,18 @@ interface HeroSectionProps {
version?: string;
}
export function HeroSection({ version = '5.0.0' }: HeroSectionProps) {
export function HeroSection({ version }: HeroSectionProps) {
return (
<div className="flex items-center gap-4">
<CcsLogo size="lg" showText={false} />
<div>
<div className="flex items-center gap-3">
<h1 className="text-2xl font-bold">CCS Config</h1>
<Badge variant="outline" className="font-mono text-xs">
v{version}
</Badge>
{version && (
<Badge variant="outline" className="font-mono text-xs">
v{version}
</Badge>
)}
</div>
<p className="text-muted-foreground text-sm mt-1">Claude Code Switch Dashboard</p>
</div>