import APIClient
import Localization
import ShareAssetClient
import SwiftUI

struct VisualizerGalleryPresetsV1: VisualizerGalleryConfigSet {
    var defaultIndex: Int {
        return 2
    }

    func configs(_ clip: Clip) -> [VisualizerAssetConfig] {
        let songArt = clip.songArtConfig(id: "SongArtV1", lyricsStyle: .lyricsBox, stickerStyle: .coreLyricsStandard)

        let auraBlueV1: VisualizerAssetConfig = .init(
            id: "AuraBlue-V1",
            displayName: L10n.FeatureShareAssets.auraMidnight,
            shareAssetConfig: .init(
                backgroundPreset: .auraBlue,
                stickerStyle: .coreLyricsStandard,
                lyricsStyle: .lyricsThreeLine
            )
        )

        let auraPurpleV1: VisualizerAssetConfig = .init(
            id: "AuraBlue-V3",
            displayName: L10n.FeatureShareAssets.auraMidnight,
            shareAssetConfig: .init(
                backgroundPreset: .auraPurple,
                stickerStyle: .coreLyricsStandard,
                lyricsStyle: .lyricsThreeLine
            )
        )

        let cloudsStandardV1: VisualizerAssetConfig = .init(
            id: "CloudsStandard-V1",
            displayName: "Clouds",
            shareAssetConfig: .init(
                backgroundPreset: .cloudSky,
                stickerStyle: .coreLyricsStandard,
                lyricsStyle: .lyricsTwoLine
            )
        )

        let auraStandardV1: VisualizerAssetConfig = .init(
            id: "AuraBlue-V2",
            displayName: L10n.FeatureShareAssets.auraDaylight,
            shareAssetConfig: .init(
                backgroundPreset: .auraStandard,
                stickerStyle: .leadingInfoStandard,
                lyricsStyle: .none
            )
        )

        let gooWavesV1: VisualizerAssetConfig = .init(
            id: "GooWaves-V2",
            displayName: "Goo Waves",
            shareAssetConfig: .init(
                backgroundPreset: .gooWaves,
                stickerStyle: .coreLyricsStandard,
                lyricsStyle: .lyricsThreeLine
            )
        )

        let gridWarpV1: VisualizerAssetConfig = .init(
            id: "GridWarp-V1",
            displayName: "Grid Warp",
            shareAssetConfig: .init(
                backgroundPreset: .gridWarpPink,
                stickerStyle: .coreInfoStandard,
                lyricsStyle: .lyricsBox
            )
        )

        let gridWarpV2: VisualizerAssetConfig = .init(
            id: "GridWarp-V2",
            displayName: "Grid Warp",
            shareAssetConfig: .init(
                backgroundPreset: .gridWarpBlue,
                stickerStyle: .coreLyricsStandard,
                lyricsStyle: .lyricsTwoLine
            )
        )

        let configs: [VisualizerAssetConfig] = [
            auraPurpleV1,
            auraBlueV1,
            songArt,
            auraStandardV1,
            cloudsStandardV1,
            gooWavesV1,
            gridWarpV1,
            gridWarpV2,
        ]

        return configs
    }
}
