|
1
|
import { useState } from "react"; |
|
2
|
import { |
|
3
|
Download, |
|
4
|
ExternalLink, |
|
5
|
ShieldCheck, |
|
6
|
CheckCircle2, |
|
7
|
Sparkles, |
|
8
|
HardDrive, |
|
9
|
Cpu, |
|
10
|
Layers, |
|
11
|
Terminal, |
|
12
|
FileCode, |
|
13
|
Zap, |
|
14
|
Copy, |
|
15
|
Check |
|
16
|
} from "lucide-react"; |
|
17
|
import { Badge } from "@/components/ui/badge"; |
|
18
|
import { Button } from "@/components/ui/button"; |
|
19
|
import { useToast } from "@/hooks/use-toast"; |
|
20
|
import { cn } from "@/lib/utils"; |
|
21
|
|
|
22
|
interface SoftwareLinksProps { |
|
23
|
deviceType?: string; |
|
24
|
} |
|
25
|
|
|
26
|
interface SoftwareTool { |
|
27
|
name: string; |
|
28
|
category: string; |
|
29
|
description: string; |
|
30
|
url: string; |
|
31
|
free: boolean; |
|
32
|
license: string; |
|
33
|
icon: any; |
|
34
|
} |
|
35
|
|
|
36
|
const ESSENTIAL_TOOLS: SoftwareTool[] = [ |
|
37
|
{ |
|
38
|
name: "HWiNFO64", |
|
39
|
category: "Hardware Diagnostics", |
|
40
|
description: "In-depth hardware monitoring and sensor logging for temperatures, voltages, and thermal throttling.", |
|
41
|
url: "https://www.hwinfo.com/download/", |
|
42
|
free: true, |
|
43
|
license: "Free", |
|
44
|
icon: Cpu, |
|
45
|
}, |
|
46
|
{ |
|
47
|
name: "CrystalDiskInfo", |
|
48
|
category: "Storage Health", |
|
49
|
description: "S.M.A.R.T. disk analysis detecting bad sectors, remaining SSD endurance, and overheating NVMe drives.", |
|
50
|
url: "https://crystalmark.info/en/software/crystaldiskinfo/", |
|
51
|
free: true, |
|
52
|
license: "Open Source", |
|
53
|
icon: HardDrive, |
|
54
|
}, |
|
55
|
{ |
|
56
|
name: "PassMark MemTest86", |
|
57
|
category: "Memory Diagnostics", |
|
58
|
description: "Gold standard standalone USB RAM defect tester with 13 rigorous multi-threaded memory patterns.", |
|
59
|
url: "https://www.memtest86.com/download.html", |
|
60
|
free: true, |
|
61
|
license: "Free", |
|
62
|
icon: Layers, |
|
63
|
}, |
|
64
|
{ |
|
65
|
name: "Display Driver Uninstaller (DDU)", |
|
66
|
category: "GPU Driver Cleanup", |
|
67
|
description: "Complete uninstallation of AMD/NVIDIA/Intel graphics drivers to resolve black screens and stuttering.", |
|
68
|
url: "https://www.wagnardsoft.com/display-driver-uninstaller-ddu-", |
|
69
|
free: true, |
|
70
|
license: "Free", |
|
71
|
icon: FileCode, |
|
72
|
}, |
|
73
|
{ |
|
74
|
name: "Rufus USB Utility", |
|
75
|
category: "Bootable OS Media", |
|
76
|
description: "Fastest bootable USB maker with Windows 11 TPM bypass and ISO auto-downloader.", |
|
77
|
url: "https://rufus.ie/", |
|
78
|
free: true, |
|
79
|
license: "Open Source", |
|
80
|
icon: Terminal, |
|
81
|
}, |
|
82
|
{ |
|
83
|
name: "Clonezilla Live", |
|
84
|
category: "Disk Cloning", |
|
85
|
description: "Bare-metal partition cloning and sector-by-sector drive backup without booting into Windows.", |
|
86
|
url: "https://clonezilla.org/downloads.php", |
|
87
|
free: true, |
|
88
|
license: "Open Source", |
|
89
|
icon: HardDrive, |
|
90
|
}, |
|
91
|
]; |
|
92
|
|
|
93
|
export default function SoftwareLinks({ deviceType = "All Devices" }: SoftwareLinksProps) { |
|
94
|
const [copiedName, setCopiedName] = useState<string | null>(null); |
|
95
|
const { toast } = useToast(); |
|
96
|
|
|
97
|
const handleLaunch = (url: string, name: string) => { |
|
98
|
window.open(url, '_blank', 'noopener,noreferrer'); |
|
99
|
toast({ |
|
100
|
title: `Opening ${name}`, |
|
101
|
description: "Directing to the official developer download page.", |
|
102
|
}); |
|
103
|
}; |
|
104
|
|
|
105
|
const handleCopyLink = (url: string, name: string) => { |
|
106
|
navigator.clipboard.writeText(url); |
|
107
|
setCopiedName(name); |
|
108
|
toast({ |
|
109
|
title: "Link copied!", |
|
110
|
description: `Official URL for ${name} copied to clipboard.`, |
|
111
|
}); |
|
112
|
setTimeout(() => setCopiedName(null), 2000); |
|
113
|
}; |
|
114
|
|
|
115
|
return ( |
|
116
|
<div className="rounded-3xl border border-border/50 bg-card/60 backdrop-blur-xl p-6 sm:p-8 space-y-6 shadow-sm"> |
|
117
|
|
|
118
|
{/* Header */} |
|
119
|
<div className="flex flex-col sm:flex-row sm:items-center justify-between gap-4 border-b border-border/40 pb-5"> |
|
120
|
<div> |
|
121
|
<div className="flex items-center gap-2 mb-1"> |
|
122
|
<span className="inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border border-emerald-500/20 text-[11px] font-bold uppercase tracking-wider"> |
|
123
|
<ShieldCheck className="h-3 w-3" /> Verified Diagnostic Suite |
|
124
|
</span> |
|
125
|
</div> |
|
126
|
<h3 className="text-xl sm:text-2xl font-bold tracking-tight"> |
|
127
|
Essential Technician Software & Download Hub |
|
128
|
</h3> |
|
129
|
<p className="text-xs text-muted-foreground"> |
|
130
|
Official tools for S.M.A.R.T. health checks, RAM validation, OS installation, and driver purge. |
|
131
|
</p> |
|
132
|
</div> |
|
133
|
|
|
134
|
<div className="flex items-center gap-2 text-xs font-semibold text-emerald-500 shrink-0"> |
|
135
|
<CheckCircle2 className="h-4 w-4" /> |
|
136
|
<span>100% Verified Official Downloads</span> |
|
137
|
</div> |
|
138
|
</div> |
|
139
|
|
|
140
|
{/* Grid of Tools */} |
|
141
|
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-5"> |
|
142
|
{ESSENTIAL_TOOLS.map((tool, idx) => { |
|
143
|
const Icon = tool.icon; |
|
144
|
return ( |
|
145
|
<div |
|
146
|
key={idx} |
|
147
|
className="rounded-2xl border border-border/60 bg-background/60 p-5 flex flex-col justify-between hover:border-emerald-500/40 hover:shadow-md transition-all space-y-4" |
|
148
|
> |
|
149
|
<div className="space-y-2.5"> |
|
150
|
<div className="flex items-start justify-between gap-2"> |
|
151
|
<div className="flex items-center gap-2.5"> |
|
152
|
<div className="h-8 w-8 rounded-xl bg-primary/10 text-primary flex items-center justify-center shrink-0"> |
|
153
|
<Icon className="h-4 w-4" /> |
|
154
|
</div> |
|
155
|
<div> |
|
156
|
<h4 className="font-bold text-sm text-foreground">{tool.name}</h4> |
|
157
|
<span className="text-[11px] text-muted-foreground">{tool.category}</span> |
|
158
|
</div> |
|
159
|
</div> |
|
160
|
|
|
161
|
<Badge variant="secondary" className="text-[10px] font-bold px-2 py-0.5 bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border border-emerald-500/20 shrink-0"> |
|
162
|
{tool.license} |
|
163
|
</Badge> |
|
164
|
</div> |
|
165
|
|
|
166
|
<p className="text-xs text-muted-foreground leading-relaxed"> |
|
167
|
{tool.description} |
|
168
|
</p> |
|
169
|
</div> |
|
170
|
|
|
171
|
<div className="flex items-center gap-2 pt-1"> |
|
172
|
<Button |
|
173
|
onClick={() => handleLaunch(tool.url, tool.name)} |
|
174
|
className="flex-1 rounded-xl h-9 text-xs font-bold gap-1.5 bg-emerald-600 hover:bg-emerald-700 text-white" |
|
175
|
> |
|
176
|
<Download className="h-3.5 w-3.5" /> |
|
177
|
<span>Download / Official Site</span> |
|
178
|
<ExternalLink className="h-3 w-3 opacity-60" /> |
|
179
|
</Button> |
|
180
|
|
|
181
|
<Button |
|
182
|
variant="outline" |
|
183
|
size="icon" |
|
184
|
onClick={() => handleCopyLink(tool.url, tool.name)} |
|
185
|
className="rounded-xl h-9 w-9 border-border/60 hover:border-emerald-500/40 shrink-0" |
|
186
|
title="Copy link" |
|
187
|
> |
|
188
|
{copiedName === tool.name ? ( |
|
189
|
<Check className="h-3.5 w-3.5 text-emerald-500" /> |
|
190
|
) : ( |
|
191
|
<Copy className="h-3.5 w-3.5 text-muted-foreground" /> |
|
192
|
)} |
|
193
|
</Button> |
|
194
|
</div> |
|
195
|
</div> |
|
196
|
); |
|
197
|
})} |
|
198
|
</div> |
|
199
|
|
|
200
|
{/* Safety Notice */} |
|
201
|
<div className="rounded-2xl border border-emerald-500/20 bg-emerald-500/5 p-4 flex items-start gap-3 text-xs text-foreground/80"> |
|
202
|
<ShieldCheck className="h-4 w-4 text-emerald-500 shrink-0 mt-0.5" /> |
|
203
|
<div> |
|
204
|
<span className="font-bold text-emerald-600 dark:text-emerald-400">Security & Integrity Assurance: </span> |
|
205
|
All links open the official vendor and open-source project repositories directly. Never download repair utilities from unverified third-party mirrors or bundled download managers. |
|
206
|
</div> |
|
207
|
</div> |
|
208
|
|
|
209
|
</div> |
|
210
|
); |
|
211
|
} |