//
//  ProjectSlideshowView.swift
//  OnCue
//
//  Created by Pradyun Setti on 22/06/2024.
//

import SwiftUI

struct ProjectSlideshowView: View {
    let project: OCProject
    
    var body: some View {
        TabView() {
            ForEach(project.cards) { card in
                CueCardView(card: card)
            }
        }
        .tabViewStyle(PageTabViewStyle(indexDisplayMode: .always))
        .toolbar {
            ToolbarItem(placement: .topBarTrailing) {
                NavigationLink(destination: { CardsView(project: project) }) {
                    Image(systemName: "stop.fill")
                }
            }
        }
    }
}

struct CueCardView: View {
    let card: OCCard
    
    var body: some View {
        VStack(alignment: .leading) {
            Text(card.content)
                .foregroundColor(.primary)
                .font(.system(size: 25))
                .padding()
                .frame(height: 550)
            Spacer()
        }
    }
}

#Preview {
    ProjectSlideshowView(project: PreviewData.project)
}
