import SwiftUI // MARK: - Input Hint Component struct InputHintView: View { let hint: String let icon: String let color: Color init(hint: String, icon: String = "info.circle", color: Color = .blue) { self.hint = hint self.icon = icon self.color = color } var body: some View { VStack(spacing: 12) { HStack { Image(systemName: icon) .font(.caption) .foregroundColor(color) Text("input_hint".localized) .font(.caption) .foregroundColor(.primary) Spacer() } Text(hint) .font(.caption) .foregroundColor(.secondary) .lineLimit(nil) } .padding(.horizontal, 12) .padding(.vertical, 8) .background( RoundedRectangle(cornerRadius: 8) .fill(color.opacity(0.1)) ) } } // MARK: - Predefined Hint Styles extension InputHintView { static func info(hint: String) -> InputHintView { InputHintView(hint: hint, icon: "info.circle", color: .blue) } static func warning(hint: String) -> InputHintView { InputHintView(hint: hint, icon: "exclamationmark.triangle", color: .orange) } static func success(hint: String) -> InputHintView { InputHintView(hint: hint, icon: "checkmark.circle", color: .green) } static func error(hint: String) -> InputHintView { InputHintView(hint: hint, icon: "xmark.circle", color: .red) } } #Preview { VStack(spacing: 16) { InputHintView.info(hint: "info_hint".localized) InputHintView.warning(hint: "warning_hint".localized) InputHintView.success(hint: "success_hint".localized) InputHintView.error(hint: "error_hint".localized) } .padding() }