import Localization
import SwiftUI

public struct ClipSuggestionsView: View {
    var suggestions: [String]
    var random: () -> Void
    var selected: (String) -> Void

    public init(
        suggestions: [String],
        random: @escaping () -> Void,
        selected: @escaping (String) -> Void
    ) {
        self.suggestions = suggestions
        self.random = random
        self.selected = selected
    }

    public var body: some View {
        Button {
            random()
        } label: {
            Image.Icon.dice
                .suggestionStyle()
        }

        ForEach(suggestions, id: \.self) { prompt in
            Button {
                selected(prompt)
            } label: {
                Text(prompt)
                    .suggestionStyle()
            }
        }
    }
}
