import Foundation struct RedditSubmitPrefill: Equatable, Sendable { let postType: RedditPostType let body: String let pollOptions: [String] let pollDurationDays: Int static func from(draft: PostDraft) -> RedditSubmitPrefill? { guard draft.postType == .poll else { return nil } let options = draft.pollOptions .map { $0.text.trimmingCharacters(in: .whitespaces) } .filter { !$0.isEmpty } guard options.count >= 2 else { return nil } return RedditSubmitPrefill( postType: .poll, body: draft.body.trimmingCharacters(in: .whitespaces), pollOptions: options, pollDurationDays: draft.pollDuration.rawValue ) } }