| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- import Foundation
- enum RedditPostType: String, CaseIterable, Identifiable {
- 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 {
- 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 {
- 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?
- }
|