import SwiftUI
import Bedrock

/// Content layout for action rows - icon, text, chevron.
struct ActionRowContent: View {
    let title: String
    let subtitle: String?
    let systemImage: String

    init(title: String, subtitle: String? = nil, systemImage: String) {
        self.title = title
        self.subtitle = subtitle
        self.systemImage = systemImage
    }

    var body: some View {
        HStack(spacing: Design.Spacing.medium) {
            Image(systemName: systemImage)
                .foregroundStyle(Color.Accent.red)
                .frame(width: Design.CardSize.avatarSize, height: Design.CardSize.avatarSize)
                .background(Color.AppBackground.accent)
                .clipShape(.rect(cornerRadius: Design.CornerRadius.medium))

            VStack(alignment: .leading, spacing: Design.Spacing.xxSmall) {
                Text(title)
                    .typography(.heading)
                    .foregroundStyle(Color.Text.primary)

                if let subtitle {
                    Text(subtitle)
                        .typography(.subheading)
                        .foregroundStyle(Color.Text.secondary)
                }
            }

            Spacer()

            Image(systemName: "chevron.right")
                .foregroundStyle(Color.Text.secondary)
        }
        .padding(Design.Spacing.large)
        .background(Color.AppBackground.elevated)
        .clipShape(.rect(cornerRadius: Design.CornerRadius.large))
    }
}
