// // ExampleView.swift // shortcut // // Created by Bailey Townsend on 7/8/25. // import SwiftUI struct ExampleView: View { let example: Example var body: some View { ScrollView { VStack(alignment: .leading, spacing: 16) { HStack(spacing: 12) { Image(systemName: example.icon) .font(.system(size: 40)) .foregroundColor(.accentColor) Text(example.title) .font(.title) .fontWeight(.bold) } Text(example.description) .font(.body) if !example.shortcutActionsUsed.isEmpty { VStack(alignment: .leading, spacing: 8) { Text("Used Shortcut Actions") .font(.headline) ForEach(example.shortcutActionsUsed.indices, id: \.self) { index in Text("• \(example.shortcutActionsUsed[index])") .font(.subheadline) } } } if let url = example.url { Link(destination: url) { Label("Download Example", systemImage: "link") .font(.body) .foregroundColor(.blue) } } Spacer() } .padding() } // .navigationTitle(Text(example.title)) // .navigationBarTitleDisplayMode(.inline) } } // Preview #Preview { NavigationView { ExampleView( example: Example( title: "Sample Shortcut", icon: "star.fill", description: "This is a sample shortcut that demonstrates how to use various actions together.", shortcutActionsUsed: ["Get Text", "Show Result", "Ask for Input"], url: URL(string: "https://example.com") )) } }