import ComponentLibrary
import SwiftUI

struct InspoButtonBordered: View {
    var title: String
    var action: () -> Void

    var body: some View {
        Button(action: action) {
            HStack(spacing: 6) {
                Image.Icon.create
                    .resizable()
                    .frame(width: 24, height: 24, alignment: .center)
                    .foregroundStyle(.linearGradient(Gradient(colors: [.purple, .blue, .red]), startPoint: .leading, endPoint: .bottom))

                Text(title)
                    .typographyV1(.body1)
                    .foregroundStyle(Color.SemanticV1.textPrimary)
                    .frame(maxWidth: .infinity, alignment: .leading)
                    .contentShape(.rect)

                Image.Icon.arrowRight
                    .foregroundStyle(Color.SemanticV1.iconTertiary)
            }
            .foregroundStyle(Color.SemanticV1.textPrimary)
            .padding(.vertical, 12)
            .padding(.horizontal, 16)
        }
        .contentShape(.rect)
        .buttonStyle(.plain)
    }
}

struct InspoButtonPlain: View {
    var title: String
    var action: () -> Void

    var body: some View {
        Button(action: action) {
            HStack(spacing: 8) {
                Image.Icon.refresh
                    .resizable()
                    .frame(width: 16, height: 16, alignment: .center)

                Text(title)
                    .typographyV1(.body1)
                    .frame(maxWidth: .infinity, alignment: .leading)
                    .contentShape(.rect)
            }
            .foregroundStyle(Color.SemanticV1.textLink)
            .padding(.horizontal, 8)
            .padding(.vertical, 12)
        }
        .contentShape(.rect)
        .buttonStyle(.plain)
    }
}
