gitbay/Discovery/ExploreViewModel.swift
14 lines · 485 bytes
1import Foundation
2
3/// One row of `explore` — a public repository on this instance.
4nonisolated struct PublicRepo: Decodable, Sendable, Hashable, Identifiable {
5 let path: String
6 let description: String?
7 let archived: Bool?
8 let topics: [String]?
9
10 var id: String { path }
11 var isArchived: Bool { archived ?? false }
12 var name: String { String(path.split(separator: "/").last ?? "") }
13 var owner: String { String(path.split(separator: "/").first ?? "") }
14}