//
//  PlaceholderRootViews.swift
//  suixinkan
//
//  Created by Codex on 2026/6/18.
//

import SwiftUI

/// 首页根视图，占位承载后续首页迁移内容。
struct HomeRootView: View {
    var body: some View {
        HomeView()
    }
}

/// 订单根视图，占位承载后续订单模块迁移内容。
struct OrdersRootView: View {
    var body: some View {
        OrdersView()
    }
}

/// 数据根视图，占位承载后续统计模块迁移内容。
struct StatisticsRootView: View {
    var body: some View {
        StatisticsView()
    }
}

/// 我的根视图，当前承载个人信息页面。
struct ProfileRootView: View {
    var body: some View {
        ProfileView()
    }
}

/// 通用 Tab 占位视图，用于未迁移模块的临时入口。
private struct PlaceholderTabRootView: View {
    @Environment(RouterPath.self) private var router

    let title: String
    let systemImage: String

    var body: some View {
        VStack(spacing: 16) {
            Image(systemName: systemImage)
                .font(.system(size: 44, weight: .semibold))
                .foregroundStyle(.tint)

            Text(title)
                .font(.title2.weight(.semibold))

            Button {
                router.navigate(to: .placeholder(title: "\(title)详情"))
            } label: {
                Label("打开详情", systemImage: "chevron.right")
            }
            .buttonStyle(.borderedProminent)
        }
        .frame(maxWidth: .infinity, maxHeight: .infinity)
        .background(Color(.systemGroupedBackground))
    }
}

/// 通用占位详情页，用于验证 Tab 内 NavigationStack 跳转。
struct PlaceholderDetailView: View {
    let title: String

    var body: some View {
        Text(title)
            .font(.title3.weight(.medium))
            .frame(maxWidth: .infinity, maxHeight: .infinity)
            .background(Color(.systemGroupedBackground))
            .navigationTitle(title)
    }
}
