//
//  LiveRoomDonationRankingTotalCanView.swift
//  SodaLive
//
//  Created by klaus on 2023/08/15.
//

import SwiftUI

struct LiveRoomDonationRankingTotalCanView: View {
    
    let totalCan: Int
    let totalSecretCan: Int
    
    var body: some View {
        HStack(alignment: .center, spacing: 0) {
            Text("합계")
                .font(.custom(Font.bold.rawValue, size: 13.3))
                .foregroundColor(Color.grayd2)
            
            if totalSecretCan > 0 {
                Text(" (")
                    .font(.custom(Font.medium.rawValue, size: 13.3))
                    .foregroundColor(Color.grayd2)
                
                Text("일반")
                    .font(.custom(Font.medium.rawValue, size: 13.3))
                    .foregroundColor(Color.button)
                
                Text("/")
                    .font(.custom(Font.medium.rawValue, size: 13.3))
                    .foregroundColor(Color.grayd2)
                
                Text("비밀")
                    .font(.custom(Font.medium.rawValue, size: 13.3))
                    .foregroundColor(Color(hex: "fedc00"))
                
                Text(")")
                    .font(.custom(Font.medium.rawValue, size: 13.3))
                    .foregroundColor(Color.grayd2)
            }
            
            Spacer()
            
            Text("\(totalCan)")
                .font(.custom(Font.medium.rawValue, size: 14))
                .foregroundColor(Color.button)
            
            if totalSecretCan > 0 {
                Text("/")
                    .font(.custom(Font.medium.rawValue, size: 14))
                    .foregroundColor(Color.white)
                Text("\(totalSecretCan)")
                    .font(.custom(Font.medium.rawValue, size: 14))
                    .foregroundColor(Color(hex: "fedc00"))
            }
            
            Text("캔")
                .font(.custom(Font.medium.rawValue, size: 10.7))
                .foregroundColor(Color.graybb)
                .padding(.leading, 4)
        }
        .padding(.horizontal, 18.7)
        .padding(.vertical, 10.7)
        .background(Color.bg)
        .cornerRadius(8)
    }
}

#Preview {
    LiveRoomDonationRankingTotalCanView(totalCan: 10, totalSecretCan: 0)
}
