import SwiftUI

@MainActor
enum AppRoute: Hashable {
    case avatarBox
    case feedbackView
    case feedbackDetail(type: FeedbackView.FeedbackType)
    case mediaUpload
    // Add other routes here as needed
    
    @ViewBuilder
    var view: some View {
        switch self {
        case .avatarBox:
            AvatarBoxView()
        case .feedbackView:
            FeedbackView()
        case .feedbackDetail(let type):
            FeedbackDetailView(feedbackType: type)
        case .mediaUpload:
            MediaUploadView()
        }
    }
}

@MainActor
class Router: ObservableObject {
    static let shared = Router()
    
    @Published var path = NavigationPath()
    
    private init() {}
    
    func navigate(to destination: AppRoute) {
        path.append(destination)
    }
    
    func pop() {
        path.removeLast()
    }
    
    func popToRoot() {
        path = NavigationPath()
    }
}
