// // WelcomeView.swift // Poche // // Author: Simon-Pierre Boucher // Contact: contact@spboucher.ai // import SwiftUI /// Empty state: the promise, then three one-tap ways to try the agent. struct WelcomeView: View { let onSuggestion: (String) -> Void private static let suggestions: [(icon: String, text: String)] = [ ("bell", "Rappelle-moi d'appeler le dentiste demain à 9 h"), ("calendar", "Qu'est-ce que j'ai au programme cette semaine ?"), ("note.text", "Note que je dois renouveler mon passeport"), ] var body: some View { VStack(spacing: 0) { Spacer() BrandMark(size: 76) .padding(.bottom, Theme.spacingLarge) Text("Ton agent, sur ton appareil.") .font(.title2.weight(.bold)) .multilineTextAlignment(.center) Text("Hors ligne. Privé. Rien ne quitte ton iPhone.") .font(.subheadline) .foregroundStyle(.secondary) .padding(.top, Theme.spacingSmall) Spacer() VStack(spacing: Theme.spacingSmall + 4) { ForEach(Self.suggestions, id: \.text) { suggestion in Button { onSuggestion(suggestion.text) } label: { HStack(spacing: Theme.spacingMedium) { Image(systemName: suggestion.icon) .font(.system(size: 15, weight: .semibold)) .foregroundStyle(Theme.accentGradient) .frame(width: 22) Text(suggestion.text) .font(.subheadline.weight(.medium)) .foregroundStyle(.primary) .multilineTextAlignment(.leading) Spacer() } .padding(.horizontal, Theme.spacingMedium + 4) .padding(.vertical, Theme.spacingMedium) .background(Theme.surface) .clipShape(RoundedRectangle(cornerRadius: Theme.cardCornerRadius - 4)) .overlay { RoundedRectangle(cornerRadius: Theme.cardCornerRadius - 4) .strokeBorder(Theme.accentA.opacity(0.14)) } } .buttonStyle(.plain) } } .padding(.horizontal, Theme.spacingLarge) .padding(.bottom, Theme.spacingMedium) } .frame(maxWidth: .infinity, maxHeight: .infinity) } }