import SwiftUI

struct VideoSelectionCard: View {
    let onDismiss: () -> Void
    
    var body: some View {
        HStack(spacing: 8) {
            // Video thumbnail with play icon
            ZStack {
                // Wobbly Wiggly background image
                Image("wobbly_wiggly")
                    .resizable()
                    .aspectRatio(contentMode: .fill)
                    .frame(width: 33, height: 40)
                    .clipShape(RoundedRectangle(cornerRadius: 8))
                
                // Play icon overlay
                Image("Icon/play")
                    .resizable()
                    .renderingMode(.template)
                    .foregroundColor(.white)
                    .frame(width: 16, height: 16)
            }
            
            // "Video" label
            Text("Video")
                .font(Constants.Typography.small)
                .foregroundColor(Constants.Colors.Foreground.primary)
            
            Spacer()
            
            // Close button
            Button(action: onDismiss) {
                Image("Icon/close")
                    .resizable()
                    .renderingMode(.template)
                    .foregroundColor(Constants.Colors.Foreground.tertiary)
                    .frame(width: 16, height: 16)
            }
            .buttonStyle(PlainButtonStyle())
        }
        .padding(.horizontal, 16)
        .frame(height: 56)
        .background(Constants.Colors.Background.Fog.thin)
        .clipShape(RoundedRectangle(cornerRadius: 16))
    }
}

#Preview {
    VideoSelectionCard {
        print("Video card dismissed")
    }
    .padding()
    .background(Constants.Colors.Background.primary)
}