KMM (Android/Shared): - Add strings.xml with 200+ localized strings - Add translation files for es, fr, de, pt languages - Update all screens to use stringResource() for i18n - Add Accept-Language header to API client for all platforms iOS: - Add L10n.swift helper with type-safe string accessors - Add Localizable.xcstrings with translations for all 5 languages - Update all SwiftUI views to use L10n.* for localized strings - Localize Auth, Residence, Task, Contractor, Document, and Profile views Supported languages: English, Spanish, French, German, Portuguese 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
82 lines
3.1 KiB
Swift
82 lines
3.1 KiB
Swift
import SwiftUI
|
|
import ComposeApp
|
|
|
|
/// Dynamic task column view that adapts based on the column configuration
|
|
struct DynamicTaskColumnView: View {
|
|
let column: TaskColumn
|
|
let onEditTask: (TaskResponse) -> Void
|
|
let onCancelTask: (Int32) -> Void
|
|
let onUncancelTask: (Int32) -> Void
|
|
let onMarkInProgress: (Int32) -> Void
|
|
let onCompleteTask: (TaskResponse) -> Void
|
|
let onArchiveTask: (Int32) -> Void
|
|
let onUnarchiveTask: (Int32) -> Void
|
|
|
|
// Get icon from API response, with fallback
|
|
private var columnIcon: String {
|
|
column.icons["ios"] ?? "list.bullet"
|
|
}
|
|
|
|
private var columnColor: Color {
|
|
Color(hex: column.color) ?? Color.appTextPrimary
|
|
}
|
|
|
|
var body: some View {
|
|
VStack(spacing: 0) {
|
|
ScrollView {
|
|
VStack(spacing: 16) {
|
|
// Header
|
|
HStack(spacing: 8) {
|
|
Image(systemName: columnIcon)
|
|
.font(.headline)
|
|
.foregroundColor(columnColor)
|
|
|
|
Text(column.displayName)
|
|
.font(.headline)
|
|
.foregroundColor(columnColor)
|
|
|
|
Spacer()
|
|
|
|
Text("\(column.count)")
|
|
.font(.caption)
|
|
.fontWeight(.semibold)
|
|
.foregroundColor(Color.appTextOnPrimary)
|
|
.padding(.horizontal, 8)
|
|
.padding(.vertical, 4)
|
|
.background(columnColor)
|
|
.cornerRadius(12)
|
|
}
|
|
|
|
if column.tasks.isEmpty {
|
|
VStack(spacing: 8) {
|
|
Image(systemName: columnIcon)
|
|
.font(.system(size: 40))
|
|
.foregroundColor(columnColor.opacity(0.3))
|
|
|
|
Text(L10n.Tasks.noTasks)
|
|
.font(.caption)
|
|
.foregroundColor(Color.appTextSecondary)
|
|
}
|
|
.frame(maxWidth: .infinity)
|
|
.padding(.top, 40)
|
|
} else {
|
|
ForEach(column.tasks, id: \.id) { task in
|
|
DynamicTaskCard(
|
|
task: task,
|
|
buttonTypes: column.buttonTypes,
|
|
onEdit: { onEditTask(task) },
|
|
onCancel: { onCancelTask(task.id) },
|
|
onUncancel: { onUncancelTask(task.id) },
|
|
onMarkInProgress: { onMarkInProgress(task.id) },
|
|
onComplete: { onCompleteTask(task) },
|
|
onArchive: { onArchiveTask(task.id) },
|
|
onUnarchive: { onUnarchiveTask(task.id) }
|
|
)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|