import Foundation enum CommentWriterTab: String, CaseIterable, Identifiable { case compose case preview case variants var id: String { rawValue } var title: String { switch self { case .compose: "Compose" case .preview: "Preview" case .variants: "Variants" } } } enum CommentType: String, CaseIterable, Identifiable { case topLevel case reply var id: String { rawValue } var title: String { switch self { case .topLevel: "Top-Level" case .reply: "Reply" } } var subtitle: String { switch self { case .topLevel: "Comment on the post" case .reply: "Reply to a comment" } } var systemImage: String { switch self { case .topLevel: "text.bubble" case .reply: "arrowshape.turn.up.left.fill" } } } enum CommentIntent: String, CaseIterable, Identifiable { case addValue case agree case disagree case question case funny case empathetic case technical case summary var id: String { rawValue } var title: String { switch self { case .addValue: "Add Value" case .agree: "Agree" case .disagree: "Counter" case .question: "Question" case .funny: "Funny" case .empathetic: "Empathetic" case .technical: "Technical" case .summary: "TL;DR" } } var subtitle: String { switch self { case .addValue: "Share insight or tips" case .agree: "Support the post/comment" case .disagree: "Respectful counterpoint" case .question: "Ask for clarification" case .funny: "Witty or lighthearted" case .empathetic: "Personal & relatable" case .technical: "Detailed explanation" case .summary: "Concise recap" } } var systemImage: String { switch self { case .addValue: "lightbulb.fill" case .agree: "hand.thumbsup.fill" case .disagree: "arrow.left.arrow.right" case .question: "questionmark.circle.fill" case .funny: "face.smiling.fill" case .empathetic: "heart.fill" case .technical: "wrench.and.screwdriver.fill" case .summary: "text.alignleft" } } } enum CommentLength: String, CaseIterable, Identifiable { case short case medium case long var id: String { rawValue } var title: String { switch self { case .short: "Short" case .medium: "Medium" case .long: "Long" } } var subtitle: String { switch self { case .short: "1–2 sentences" case .medium: "1–2 paragraphs" case .long: "Detailed reply" } } var wordRange: String { switch self { case .short: "20–60 words" case .medium: "60–150 words" case .long: "150–300 words" } } } enum CommentVariantCount: Int, CaseIterable, Identifiable { case three = 3 case five = 5 var id: Int { rawValue } var label: String { "\(rawValue) variants" } } struct CommentDraft: Equatable { var commentType: CommentType = .topLevel var subreddit: String = "" var postTitle: String = "" var postBody: String = "" var postURL: String = "" var parentComment: String = "" var topic: String = "" var tone: PostTone = .casual var intent: CommentIntent = .addValue var length: CommentLength = .medium var body: String = "" var includeQuote: Bool = true var useMarkdown: Bool = true var variantCount: CommentVariantCount = .three } struct CommentVariant: Identifiable, Equatable { let id: UUID var body: String var score: Int var reasoning: String init(id: UUID = UUID(), body: String, score: Int, reasoning: String) { self.id = id self.body = body self.score = score self.reasoning = reasoning } } struct GeneratedComment: Equatable { var body: String var variants: [CommentVariant] }