import Foundation
import Localization

public extension SingleButtonAlertStyle {
    enum Preset: CaseIterable {
        public static var random: Preset {
            return allCases.randomElement() ?? .videoTooShort
        }

        case videoTooShort
        case videoUploadFailed
        case inappropriateContentFlaggedWhileCreatingShort
        case addContext
        case audioUploadTerms
        case somethingWentWrong
        case editingSelectionWillClearLyrics

        var textCopy: TextCopy {
            switch self {
            // Creating a 'Suno Short' and the video is not long enough
            case .videoTooShort:
                return .init(
                    title: L10n.FeatureBrandedAlert.videoTooShort,
                    description: L10n.FeatureBrandedAlert.videosShouldBeAtLeastOneSecond,
                    buttonLabel: BrandedAlertStyle.ButtonCopy.retry.displayText
                )

            // Uploading video failed to complete
            case .videoUploadFailed:
                return .init(
                    title: L10n.FeatureBrandedAlert.uploadFailed,
                    description: L10n.FeatureBrandedAlert.weHitASnagWithYourVideo,
                    buttonLabel: BrandedAlertStyle.ButtonCopy.okay.displayText
                )

            // While creating 'Suno Short' innappropriate content was flagged
            // which gated the creation process from generating a short
            case .inappropriateContentFlaggedWhileCreatingShort:
                return .init(
                    title: L10n.FeatureBrandedAlert.inappropriateContent,
                    description: L10n.FeatureBrandedAlert.yourClipWasFlaggedAndYourShortWasntCreatedTryADifferentClip,
                    buttonLabel: BrandedAlertStyle.ButtonCopy.gotIt.displayText
                )

            case .addContext:
                return .init(
                    title: L10n.FeatureBrandedAlert.addContextTitle,
                    description: L10n.FeatureBrandedAlert.addContextMessage,
                    buttonLabel: L10n.FeatureBrandedAlert.addContextButton
                )

            case .audioUploadTerms:
                return .init(
                    showIcon: false,
                    showClose: true,
                    title: L10n.FeatureCreateClip.disclaimerTitle,
                    description: L10n.FeatureCreateClip.disclaimerMessage,
                    buttonLabel: L10n.FeatureCreateClip.agreeToTerms
                )

            case .somethingWentWrong:
                return .init(
                    title: L10n.FeatureBrandedAlert.somethingWentWrong,
                    description: L10n.FeatureBrandedAlert.itsNotYou,
                    buttonLabel: L10n.FeatureBrandedAlert.iForgiveYou
                )

            case .editingSelectionWillClearLyrics:
                return .init(
                    title: "Edit Alert",
                    description: "Changing the time selection will delete any replaced lyrics udpates",
                    buttonLabel: "OK"
                )
            }
        }
    }
}
