importCottonKitimportCottonValuesimportSwiftUIenumSettingsRing {/// The dial's Settings card, as the core keys it (`shell.fan`).staticlet tool = "settings"/// The table whose rows are its views.staticlet table = ExportFan.settingsTable/// The screen a view's page is: its row's route; nil where this build/// has none for it.staticfunc route(of view: ToolView) -> Route? { view.address.flatMap(Route.parse) }/// What holding a view opens: Settings' Export view, the export fan;/// nil for every other view.staticfunc exports(tool: String, view: ToolView) -> DeckEditTarget? {guard tool == self.tool, ExportFan.opens(table: table, record: view.id) else { returnnil }returnDeckEditTarget(table: table, record: view.id, date: nil) }}/// The Settings card's page: the chosen view's own screen, drawn in place;/// where no fan stands (the Mac), Settings' own list.structSettingsPage: View {/// What a route draws, as the route table draws it (`RouteScreen`).let screen: @MainActor (Route) -> AnyView @Environment(ToolViews.self) privatevar views: ToolViews?var body: someView {iflet views {iflet view = views.current(of: SettingsRing.tool) {iflet route = SettingsRing.route(of: view) { screen(route).id(view.id) } else {PaperScreen(title: view.label) {QuietState(title: ShellLines.line("lists", "destination.cannot_open"), message: "") } } } else {PaperScreen { EmptyView() } // no loader: the fan's answer lands next frame } } else {TableListRoute(table: SettingsRing.table) } }}