@_private(sourceFile: "CardsView.swift") import OnCue
import func SwiftUI.__designTimeBoolean
import func SwiftUI.__designTimeInteger
import protocol SwiftUI.PreviewProvider
import func SwiftUI.__designTimeString
import func SwiftUI.__designTimeFloat
import struct SwiftUI.EmptyView
import protocol SwiftUI.View
import SwiftUI

extension CardView {
    @_dynamicReplacement(for: body) private var __preview__body: some View {
        #sourceLocation(file: "/Users/pradyun/Code/Apps/OnCue/OnCue/View/CardsView.swift", line: 73)
        VStack(alignment: .trailing) {
            Text(card.content)
        }
        .frame(minHeight: __designTimeInteger("#885.[2].[2].property.[0].[0].modifier[0].arg[0].value", fallback: 80))
//        .padding()
//        .background(Color(hex: proj.color) ?? .blue)
//        .clipShape(.rect(cornerRadius: 12))
//        .padding(.horizontal)
//        .padding(.vertical)
    
#sourceLocation()
    }
}

extension CardsView {
    @_dynamicReplacement(for: deleteItems(offsets:)) private func __preview__deleteItems(offsets: IndexSet) {
        #sourceLocation(file: "/Users/pradyun/Code/Apps/OnCue/OnCue/View/CardsView.swift", line: 60)
        withAnimation {
            project.cards.remove(atOffsets: offsets)
            try! ctx.save()
        }
    
#sourceLocation()
    }
}

extension CardsView {
    @_dynamicReplacement(for: addNewCard(txt:)) private func __preview__addNewCard(txt: String) {
        #sourceLocation(file: "/Users/pradyun/Code/Apps/OnCue/OnCue/View/CardsView.swift", line: 54)
        let card = OCCard(content: txt, index: (project.cards.last?.index ?? __designTimeInteger("#885.[1].[6].[0].value.arg[1].value.[0]", fallback: -1)) + __designTimeInteger("#885.[1].[6].[0].value.arg[1].value.[1]", fallback: 1)) // adds one to the index, unless there arent any cards in which case default to 0
        project.cards.append(card)
        try! ctx.save()
    
#sourceLocation()
    }
}

extension CardsView {
    @_dynamicReplacement(for: body) private var __preview__body: some View {
        #sourceLocation(file: "/Users/pradyun/Code/Apps/OnCue/OnCue/View/CardsView.swift", line: 19)
        List {
            ForEach(project.cards) { card in
                CardView(proj: project, card: card)
            }
            .onDelete(perform: deleteItems)
        }
        .listStyle(.inset)
        .navigationTitle(project.name)
        .navigationBarTitleDisplayMode(.inline)
        .toolbar {
            ToolbarItem(placement: .topBarTrailing) {
                Button(action: { addNewCard.toggle() }) {
                    Label(__designTimeString("#885.[1].[5].property.[0].[0].modifier[3].arg[0].value.[0].arg[1].value.[0].arg[1].value.[0].arg[0].value", fallback: "Add Item"), systemImage: __designTimeString("#885.[1].[5].property.[0].[0].modifier[3].arg[0].value.[0].arg[1].value.[0].arg[1].value.[0].arg[1].value", fallback: "plus"))
                }
            }
            ToolbarItem(placement: .topBarTrailing) {
                Menu {
                    NavigationLink(destination: {ProjectSlideshowView(project: project)}) {
                        Label(title: { Text(__designTimeString("#885.[1].[5].property.[0].[0].modifier[3].arg[0].value.[1].arg[1].value.[0].arg[0].value.[0].arg[1].value.[0].arg[0].value.[0].arg[0].value", fallback: "Slideshow"))}, icon: {Image(systemName: __designTimeString("#885.[1].[5].property.[0].[0].modifier[3].arg[0].value.[1].arg[1].value.[0].arg[0].value.[0].arg[1].value.[0].arg[1].value.[0].arg[0].value", fallback: "tv.fill")) })
                    }
                    NavigationLink(destination: {TeleprompterView(project: project)}) {
                        Label(title: { Text(__designTimeString("#885.[1].[5].property.[0].[0].modifier[3].arg[0].value.[1].arg[1].value.[0].arg[0].value.[1].arg[1].value.[0].arg[0].value.[0].arg[0].value", fallback: "Teleprompter"))}, icon: {Image(systemName: __designTimeString("#885.[1].[5].property.[0].[0].modifier[3].arg[0].value.[1].arg[1].value.[0].arg[0].value.[1].arg[1].value.[0].arg[1].value.[0].arg[0].value", fallback: "note.text")) })
                    }
                } label: {
                    Image(systemName: __designTimeString("#885.[1].[5].property.[0].[0].modifier[3].arg[0].value.[1].arg[1].value.[0].arg[1].value.[0].arg[0].value", fallback: "play.fill"))
                }

            }
        }
        .sheet(isPresented: $addNewCard) {
            AddNewCardView(completionHandler: addNewCard)
        }
    
#sourceLocation()
    }
}

import struct OnCue.CardsView
import struct OnCue.CardView
#Preview {
    return CardsView(project: OCProject(name: "Test", color: "FF00FF"))
}



