import SwiftUI struct OwnProfileView: View { @AppStorage("publicFeedURL") private var publicFeedURLString = "" @State private var showSettings = false private var feedURL: URL? { guard let url = URL(string: publicFeedURLString), url.scheme?.hasPrefix("http") == true, url.host != nil else { return nil } return url } var body: some View { NavigationStack { Group { if let url = feedURL { ProfileView(feedURL: url) } else { ContentUnavailableView { Label("No profile", systemImage: "person.slash") } description: { Text("Set your Feed URL in Settings to see your profile.") } actions: { Button("Open Settings") { showSettings = true } .buttonStyle(.bordered) } } } .navigationTitle("Profile") .navigationBarTitleDisplayMode(.large) .toolbar { ToolbarItem(placement: .navigationBarTrailing) { Button { showSettings = true } label: { Image(systemName: "gearshape") } } } .sheet(isPresented: $showSettings) { SettingsView() } } } }