//
//  VehicleRowView.swift
//  Gas Man
//
//  Created by Kameron Kenny on 3/18/25.
//


import SwiftUI

struct VehicleRowView: View {
    let vehicle: Vehicle

    var body: some View {
        HStack {
            if let imageData = vehicle.photo, let uiImage = UIImage(data: imageData) {
                Image(uiImage: uiImage)
                    .resizable()
                    .scaledToFill()
                    .frame(width: 50, height: 50)
                    .clipShape(Circle())
            } else {
                Circle()
                    .fill(Color.gray.opacity(0.3))
                    .frame(width: 50, height: 50)
                    .overlay(
                        Image(systemName: "car.fill")
                            .foregroundColor(.gray)
                    )
            }
            VStack(alignment: .leading) {
                Text("\(vehicle.year ?? "") \(vehicle.make ?? "") \(vehicle.model ?? "")")
                    .font(.headline)
                // Add other details if needed.
            }
        }
    }
}

