import SwiftUI

struct PagePropertyView: View {

    let title: LocalizedStringKey

    @Binding
    var selectedPage: Page?

    let footer: LocalizedStringKey

    @State
    private var showPageSelectionSheet = false

    var body: some View {
        GenericPropertyView(title: title, footer: footer) {
            HStack {
                Text(selectedPage?.identifier ?? "No page selected")
                Spacer()
                Button("Select") {
                    showPageSelectionSheet = true
                }
            }
        }
        .sheet(isPresented: $showPageSelectionSheet) {
            PagePickerView(selectedPage: $selectedPage)
        }
    }
}

