import SwiftUI

struct PRStatusStyle {
    let icon: String
    let color: Color
    let text: String

    init(state: PullRequestState, merged: Bool?, draft: Bool?) {
        let isMerged = merged == true
        let isDraft = draft == true

        if isMerged {
            icon = "arrow.triangle.merge"
            color = .purple
            text = "Merged"
        } else if isDraft, state == .open {
            icon = "circle.dashed"
            color = .green
            text = "Draft"
        } else {
            switch state {
            case .open:
                icon = "arrow.triangle.pull"
                color = .green
                text = "Open"
            default:
                icon = "xmark.circle.fill"
                color = .red
                text = "Closed"
            }
        }
    }
}
