import Foundation enum RedditPostType: String, CaseIterable, Identifiable, Codable { case text case image case link case video case poll var id: String { rawValue } var title: String { switch self { case .text: "Text" case .image: "Image" case .link: "Link" case .video: "Video" case .poll: "Poll" } } var subtitle: String { switch self { case .text: "Share thoughts & stories" case .image: "Upload photos & memes" case .link: "Share articles & URLs" case .video: "Embed or link videos" case .poll: "Ask the community" } } var systemImage: String { switch self { case .text: "text.alignleft" case .image: "photo" case .link: "link" case .video: "play.rectangle" case .poll: "chart.bar" } } } enum PostTone: String, CaseIterable, Identifiable, Codable { case casual case professional case humorous case informative case controversial case storytelling var id: String { rawValue } var title: String { switch self { case .casual: "Casual" case .professional: "Professional" case .humorous: "Humorous" case .informative: "Informative" case .controversial: "Bold" case .storytelling: "Storytelling" } } } enum PollDuration: Int, CaseIterable, Identifiable, Codable { case oneDay = 1 case threeDays = 3 case sevenDays = 7 var id: Int { rawValue } var label: String { switch self { case .oneDay: "1 day" case .threeDays: "3 days" case .sevenDays: "7 days" } } } enum PostGeneratorTab: String, CaseIterable, Identifiable { case compose case preview var id: String { rawValue } var title: String { switch self { case .compose: "Compose" case .preview: "Preview" } } } struct PollOption: Identifiable, Equatable { let id: UUID var text: String init(id: UUID = UUID(), text: String = "") { self.id = id self.text = text } } struct PostDraft: Equatable { var postType: RedditPostType = .text var subreddit: String = "" var topic: String = "" var tone: PostTone = .casual var title: String = "" var body: String = "" var linkURL: String = "" var videoURL: String = "" var imageFileURL: URL? var pollOptions: [PollOption] = [ PollOption(text: ""), PollOption(text: ""), ] var pollDuration: PollDuration = .threeDays var isNSFW: Bool = false var isSpoiler: Bool = false var isOC: Bool = false var flair: String = "" } struct GeneratedPost: Equatable { var title: String var body: String var suggestedFlair: String? var pollOptions: [String]? }