import Foundation

// MARK: - CardPosition

/// Controls where the info card is placed relative to the spotlight.
enum CardPosition: Hashable {
    case auto
    case above
    case below
    case center
}

// MARK: - TourStep

/// A single step in a guided tour.
struct TourStep: Identifiable, Hashable {
    static func == (lhs: TourStep, rhs: TourStep) -> Bool { lhs.id == rhs.id }
    func hash(into hasher: inout Hasher) { hasher.combine(id) }
    let id: UUID
    let title: LocalizedStringResource
    let body: LocalizedStringResource
    /// `nil` means a centered intro card with no spotlight.
    let target: TourTargetID?
    let preferredCardPosition: CardPosition
    let spotlightPadding: CGFloat
    let spotlightCornerRadius: CGFloat?

    init(
        id: UUID = UUID(),
        title: LocalizedStringResource,
        body: LocalizedStringResource,
        target: TourTargetID? = nil,
        preferredCardPosition: CardPosition = .auto,
        spotlightPadding: CGFloat = 12,
        spotlightCornerRadius: CGFloat? = nil
    ) {
        self.id = id
        self.title = title
        self.body = body
        self.target = target
        self.preferredCardPosition = preferredCardPosition
        self.spotlightPadding = spotlightPadding
        self.spotlightCornerRadius = spotlightCornerRadius
    }
}
