import SwiftUI

public struct CharCountV2: View {
    private var text: String
    private let limit: Int

    public init(text: String, limit: Int) {
        self.text = text
        self.limit = limit
    }

    public var body: some View {
        Text(verbatim: "\(text.count) / \(limit)")
            .typographyV1(.body4New)
            .monospacedDigit()
            .foregroundStyle(Color.SemanticV2.foregroundTertiary)
            .padding(.horizontal, 8)
            .padding(.vertical, 4)
            .background(Color.SemanticV2.backgroundGlassThin)
            .cornerRadius(.infinity)
    }
}
