]> git.r.bdr.sh - rbdr/map/blob - Map/Presentation/Base Components/EvolutionPicker.swift
03f51451c3010816cd6a481fc39c3f26aa81f2ae
[rbdr/map] / Map / Presentation / Base Components / EvolutionPicker.swift
1 /*
2 Copyright (C) 2024 Rubén Beltrán del Río
3
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see https://map.tranquil.systems.
16 */
17 import SwiftUI
18
19 struct EvolutionPicker: View {
20
21 @Binding var selectedEvolution: StageType
22
23 var body: some View {
24 Picker("Evolution", selection: $selectedEvolution) {
25 ForEach(StageType.types) { stage in
26 Text(Stage.title(stage)).font(.theme.body).tag(stage).padding(4.0)
27 }
28 Divider()
29 ForEach(StageType.characteristics) { stage in
30 Text(Stage.title(stage)).font(.theme.body).tag(stage).padding(4.0).font(.theme.body)
31 }
32 Divider()
33 ForEach(StageType.properties) { stage in
34 Text(Stage.title(stage)).font(.theme.body).tag(stage).padding(4.0)
35 }
36 Divider()
37 ForEach(StageType.custom) { stage in
38 Text(Stage.title(stage)).font(.theme.body).tag(stage).padding(4.0)
39 }
40 }.font(.theme.body).padding(.horizontal, 8.0).padding(.vertical, 4.0)
41 }
42 }
43
44 #Preview {
45 let selectedEvolution: StageType = .behavior
46 EvolutionPicker(selectedEvolution: .constant(selectedEvolution))
47 }