//
//  PodcastCover.swift
//  PodcastsApp
//
//  Created by BREUIL Yohann on 18/05/2023.
//

import SwiftUI

struct PodcastCover: View {
    var podcast: Podcast
    
    var body: some View {
        ZStack {
            Rectangle()
                .fill(.cyan)
            
            VStack {
                Image(podcast.coverImage)
                    .resizable()
                    .aspectRatio(contentMode: .fit)
                    .frame(width: 300, height: 300)
                Text(podcast.name)
                Text(podcast.creator)
                
                Button(action: {}) {
                    Image(systemName: "play.fill")
                    Text("Reprendre")
                }
                .bold()
                .frame(width: 200, height: 20, alignment: .center)
                .cornerRadius(20)
                .padding()
                .background(
                    RoundedRectangle(
                        cornerRadius: 20,
                        style: .continuous
                    )
                    .fill(.yellow))
                .overlay {
                    RoundedRectangle(
                        cornerRadius: 20,
                        style: .continuous
                    )
                    .stroke(.pink, lineWidth: 2)
                }
            }
            
        }
    }
}

struct PodcastCover_Previews: PreviewProvider {
    static var previews: some View {
        Group {
            PodcastCover(podcast: podcastList[0])
            PodcastCover(podcast: podcastList[0]).preferredColorScheme(.dark)
        }
    }
}
