crossmate

A collaborative crossword app for iOS
Log | Files | Refs | LICENSE

BundledBrowseView.swift (859B)


      1 import SwiftUI
      2 
      3 struct BundledBrowseView: View {
      4     let onSelected: (String) -> Void
      5 
      6     private var puzzles: [PuzzleCatalog.Entry] {
      7         PuzzleCatalog.bundledPuzzles()
      8     }
      9 
     10     var body: some View {
     11         List(puzzles) { entry in
     12             Button {
     13                 onSelected(entry.source)
     14             } label: {
     15                 Text(entry.title)
     16                     .foregroundStyle(.primary)
     17             }
     18         }
     19     }
     20 }
     21 
     22 struct DebugBrowseView: View {
     23     let onSelected: (String) -> Void
     24 
     25     private var puzzles: [PuzzleCatalog.Entry] {
     26         PuzzleCatalog.debugPuzzles()
     27     }
     28 
     29     var body: some View {
     30         List(puzzles) { entry in
     31             Button {
     32                 onSelected(entry.source)
     33             } label: {
     34                 Text(entry.title)
     35                     .foregroundStyle(.primary)
     36             }
     37         }
     38     }
     39 }