Skip to content

Commit f709d9e

Browse files
authored
Merge pull request #35 from cxymds/main
2 parents 4007d27 + f13492d commit f709d9e

3 files changed

Lines changed: 10123 additions & 188 deletions

File tree

app/download/components/download-section.tsx

Lines changed: 37 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
'use client'
1+
"use client";
22

33
import { type PlatformInfo } from "@/data/platforms";
44
import { useI18n } from "@/lib/i18n";
@@ -19,19 +19,13 @@ export default function DownloadSection({ platform, className }: DownloadSection
1919
return (
2020
<div className={cn("text-center py-12", className)}>
2121
<div className="w-12 h-12 rounded-full border border-border flex items-center justify-center text-muted-foreground">
22-
<div className="opacity-50">
23-
{platform.icon}
24-
</div>
22+
<div className="opacity-50">{platform.icon}</div>
2523
</div>
26-
<h2 className="text-2xl font-bold text-muted-foreground mb-2">
27-
{platform.name}
28-
</h2>
29-
<p className="text-muted-foreground mb-4">
30-
{tw('即将开放下载', 'Coming Soon')}
31-
</p>
24+
<h2 className="text-2xl font-bold text-muted-foreground mb-2">{platform.name}</h2>
25+
<p className="text-muted-foreground mb-4">{tw("即将开放下载", "Coming Soon")}</p>
3226
<div className="max-w-md mx-auto p-4 bg-muted/30 rounded-lg border border-dashed border-muted-foreground/30">
3327
<p className="text-sm text-muted-foreground">
34-
{tw('我们正在为此平台准备 RustFS,敬请期待!', 'We are preparing RustFS for this platform, stay tuned!')}
28+
{tw("我们正在为此平台准备 RustFS,敬请期待!", "We are preparing RustFS for this platform, stay tuned!")}
3529
</p>
3630
</div>
3731
</div>
@@ -47,26 +41,21 @@ export default function DownloadSection({ platform, className }: DownloadSection
4741
</div>
4842
<div>
4943
<h2 className="text-2xl font-bold text-foreground">{platform.name}</h2>
50-
<p className="text-muted-foreground">
51-
{tw(platform.description.zh, platform.description.en)}
52-
</p>
44+
<p className="text-muted-foreground">{tw(platform.description.zh, platform.description.en)}</p>
5345
</div>
5446
</div>
5547

5648
{/* Docker Installation */}
57-
{platform.id === 'docker' && platform.variants && (
49+
{platform.id === "docker" && platform.variants && (
5850
<div className="space-y-4">
5951
<div className="flex items-center space-x-2">
60-
<h3 className="text-lg font-semibold text-foreground">
61-
{tw('Docker 部署', 'Docker Deployment')}
62-
</h3>
52+
<h3 className="text-lg font-semibold text-foreground">{tw("Docker 部署", "Docker Deployment")}</h3>
6353
<a
6454
href="https://hub.docker.com/r/rustfs/rustfs"
6555
target="_blank"
6656
rel="noopener noreferrer"
67-
className="inline-flex items-center space-x-1 text-sm text-primary hover:text-primary/80"
68-
>
69-
<span>{tw('查看镜像', 'View Image')}</span>
57+
className="inline-flex items-center space-x-1 text-sm text-primary hover:text-primary/80">
58+
<span>{tw("查看镜像", "View Image")}</span>
7059
<ExternalLinkIcon className="w-3 h-3" />
7160
</a>
7261
</div>
@@ -77,24 +66,20 @@ export default function DownloadSection({ platform, className }: DownloadSection
7766
<div>
7867
<h4 className="font-medium text-foreground">{variant.name}</h4>
7968
<p className="text-sm text-muted-foreground">
80-
{tw('版本', 'Version')}: {variant.architecture}
69+
{tw("版本", "Version")}: {variant.architecture}
8170
</p>
8271
</div>
8372
<a
8473
href={variant.downloadUrl}
8574
target="_blank"
8675
rel="noopener noreferrer"
87-
className="inline-flex items-center space-x-2 px-4 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors"
88-
>
76+
className="inline-flex items-center space-x-2 px-4 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors">
8977
<ExternalLinkIcon className="w-4 h-4" />
90-
<span>{tw('查看', 'View')}</span>
78+
<span>{tw("查看", "View")}</span>
9179
</a>
9280
</div>
9381

94-
<CodeBlock
95-
code={variant.commands}
96-
title={tw('Docker 命令', 'Docker Commands')}
97-
/>
82+
<CodeBlock code={variant.commands} title={tw("Docker 命令", "Docker Commands")} />
9883

9984
{/* Variant Notes */}
10085
<NotesSection notes={variant.notes || []} />
@@ -104,34 +89,28 @@ export default function DownloadSection({ platform, className }: DownloadSection
10489
)}
10590

10691
{/* Binary Downloads */}
107-
{platform.variants && platform.variants.length > 0 && platform.id !== 'docker' && (
92+
{platform.variants && platform.variants.length > 0 && platform.id !== "docker" && (
10893
<div className="space-y-6">
109-
<h3 className="text-lg font-semibold text-foreground">
110-
{tw('二进制下载', 'Binary Downloads')}
111-
</h3>
94+
<h3 className="text-lg font-semibold text-foreground">{tw("二进制下载", "Binary Downloads")}</h3>
11295

11396
{platform.variants.map((variant, index) => (
11497
<div key={index} className="space-y-4">
11598
<div className="flex items-center justify-between">
11699
<div>
117100
<h4 className="font-medium text-foreground">{variant.name}</h4>
118101
<p className="text-sm text-muted-foreground">
119-
{tw('架构', 'Architecture')}: {variant.architecture}
102+
{tw("架构", "Architecture")}: {variant.architecture}
120103
</p>
121104
</div>
122105
<a
123106
href={variant.downloadUrl}
124-
className="inline-flex items-center space-x-2 px-4 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors"
125-
>
107+
className="inline-flex items-center space-x-2 px-4 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors">
126108
<DownloadIcon className="w-4 h-4" />
127-
<span>{tw('下载', 'Download')}</span>
109+
<span>{tw("下载", "Download")}</span>
128110
</a>
129111
</div>
130112

131-
<CodeBlock
132-
code={variant.commands}
133-
title={tw('安装命令', 'Installation Commands')}
134-
/>
113+
<CodeBlock code={variant.commands} title={tw("安装命令", "Installation Commands")} />
135114

136115
{/* Variant Notes */}
137116
<NotesSection notes={variant.notes || []} />
@@ -143,14 +122,26 @@ export default function DownloadSection({ platform, className }: DownloadSection
143122
{/* One-click Installation */}
144123
{platform.installScript && (
145124
<div className="space-y-4">
125+
<h3 className="text-lg font-semibold text-foreground">{tw("一键安装", "One-click Installation")}</h3>
126+
127+
<CodeBlock code={[platform.installScript]} title={tw("Shell 脚本", "Shell Script")} />
128+
</div>
129+
)}
130+
131+
{/* brew Installation */}
132+
{platform.brewConfig && platform.brewConfig.length > 0 && platform.id == "macos" && (
133+
<div className="space-y-6">
146134
<h3 className="text-lg font-semibold text-foreground">
147-
{tw('一键安装', 'One-click Installation')}
135+
{tw("Homebrew安装(建议)", "Via Homebrew (Recommended)")}
148136
</h3>
149137

150-
<CodeBlock
151-
code={[platform.installScript]}
152-
title={tw('Shell 脚本', 'Shell Script')}
153-
/>
138+
{platform.brewConfig.map((variant, index) => (
139+
<div key={index} className="space-y-4">
140+
{/* Notes */}
141+
<NotesSection notes={variant.notes || []} />
142+
<CodeBlock code={variant.commands} title={tw("安装命令", "Installation Commands")} />
143+
</div>
144+
))}
154145
</div>
155146
)}
156147

0 commit comments

Comments
 (0)