import CottonKit import SwiftUI /// Which databases a picked command offers, in order. Pure (`DatabasePickingTests`). enum DatabasePicking { /// The person's own databases other than the open one, in the order every /// surface draws them. One somebody else owns is never offered: what is /// handed over goes where the person decides what is kept, and one that /// is on its way out (`removed`) is no place to put anything. static func choices(_ held: [HeldDatabase], open: String?) -> [HeldDatabase] { held.filter { $0.databaseId != open && $0.rights == .owner } } }