@_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: 58)
        VStack(alignment: .trailing) {
            Text(card.content)
        }
        .frame(minHeight: __designTimeInteger("#16575.[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: 45)
        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: 39)
        let card = OCCard(content: txt, index: (project.cards.last?.index ?? __designTimeInteger("#16575.[1].[5].[0].value.arg[1].value.[0]", fallback: -1)) + __designTimeInteger("#16575.[1].[5].[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: 17)
        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("#16575.[1].[4].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("#16575.[1].[4].property.[0].[0].modifier[3].arg[0].value.[0].arg[1].value.[0].arg[1].value.[0].arg[1].value", fallback: "plus"))
                }
            }
        }
        .sheet(isPresented: $addNewCard) {
            AddNewCardView(completionHandler: addNewCard)
        }
    
#sourceLocation()
    }
}

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



