diff --git a/VoiceInk/Views/Metrics/HelpAndResourcesSection.swift b/VoiceInk/Views/Metrics/HelpAndResourcesSection.swift new file mode 100644 index 0000000..1d4e247 --- /dev/null +++ b/VoiceInk/Views/Metrics/HelpAndResourcesSection.swift @@ -0,0 +1,70 @@ +import SwiftUI + +struct HelpAndResourcesSection: View { + var body: some View { + VStack(alignment: .leading, spacing: 15) { + Text("Help & Resources") + .font(.system(size: 22, weight: .bold, design: .rounded)) + .foregroundColor(.primary.opacity(0.8)) + + VStack(alignment: .leading, spacing: 12) { + resourceLink( + icon: "sparkles", + title: "Recommended Models", + url: "https://tryvoiceink.com/recommended-models" + ) + + resourceLink( + icon: "video.fill", + title: "YouTube Videos & Guides", + url: "https://www.youtube.com/@tryvoiceink/videos" + ) + + resourceLink( + icon: "book.fill", + title: "Documentation", + url: "https://tryvoiceink.com/docs" // Placeholder + ) + } + } + .padding(22) + .padding(.vertical, 2) + .background( + RoundedRectangle(cornerRadius: 28, style: .continuous) + .fill(Color(nsColor: .windowBackgroundColor)) + ) + .overlay( + RoundedRectangle(cornerRadius: 28, style: .continuous) + .stroke(Color.primary.opacity(0.1), lineWidth: 1) + ) + } + + private func resourceLink(icon: String, title: String, url: String) -> some View { + Button(action: { + if let url = URL(string: url) { + NSWorkspace.shared.open(url) + } + }) { + HStack { + Image(systemName: icon) + .font(.system(size: 15, weight: .medium)) + .foregroundColor(.accentColor) + .frame(width: 20) + + Text(title) + .font(.system(size: 13)) + .fontWeight(.semibold) + + Spacer() + + Image(systemName: "arrow.up.right") + .foregroundColor(.secondary) + } + .padding(12) + .background(Color.primary.opacity(0.05)) + .clipShape(RoundedRectangle(cornerRadius: 12, style: .continuous)) + + } + .buttonStyle(.plain) + } +} diff --git a/VoiceInk/Views/Metrics/MetricsContent.swift b/VoiceInk/Views/Metrics/MetricsContent.swift index a01db40..c3605be 100644 --- a/VoiceInk/Views/Metrics/MetricsContent.swift +++ b/VoiceInk/Views/Metrics/MetricsContent.swift @@ -13,7 +13,10 @@ struct MetricsContent: View { VStack(spacing: 24) { heroSection metricsSection - DashboardPromotionsSection(licenseState: licenseState) + HStack(alignment: .top, spacing: 18) { + HelpAndResourcesSection() + DashboardPromotionsSection(licenseState: licenseState) + } } .padding(.vertical, 28) .padding(.horizontal, 32)