270→ @State private var creditor = "" 271→ @State private var hasDueDate = false 272→ @State private var dueDate = Date() 273→ @State private var interestRate = "" 274→ @State private var notes = "" 275→ @State private var isRecurring = false 276→ @State private var recurringAmount = "" 277→ @State private var totalInstallments = "" 278→ 279→ var body: some View { 280→ VStack(spacing: 20) { 281→ Text("Nova Divida") 282→ .font(.title2) 283→ .fontWeight(.bold) 284→ 285→ Form { 286→ TextField("Nome da divida", text: $name) 287→ TextField("Valor (R$)", text: $amount) 288→ TextField("Credor", text: $creditor) 289→ 290→ Toggle("Tem data de vencimento", isOn: $hasDueDate) 291→ if hasDueDate { 292→ DatePicker("Vencimento", selection: $dueDate, displayedComponents: .date) 293→ } 294→ 295→ TextField("Taxa de juros (%)", text: $interestRate) 296→ 297→ Toggle("Divida parcelada", isOn: $isRecurring) 298→ if isRecurring { 299→ TextField("Valor da parcela (R$)", text: $recurringAmount) 300→ TextField("Total de parcelas", text: $totalInstallments) 301→ } 302→ 303→ TextField("Notas", text: $notes) 304→ } 305→ .formStyle(.grouped) 306→ 307→ HStack { 308→ Button("Cancelar") { 309→ dismiss() 310→ } 311→ .keyboardShortcut(.escape) 312→ 313→ Spacer() 314→ 315→ Button("Salvar") { 316→ saveDebt() 317→ } 318→ .keyboardShortcut(.return) 319→ .buttonStyle(.borderedProminent) 320→ .disabled(name.isEmpty || amount.isEmpty) 321→ } 322→ } 323→ .padding() 324→ .frame(width: 400, height: 500) 325→ } 326→ 327→ private func saveDebt() { 328→ let debt = Debt( 329→ name: name, 330→ amount: Double(amount.replacingOccurrences(of: ",", with: ".")) ?? 0, 331→ creditor: creditor, 332→ dueDate: hasDueDate ? dueDate : nil, 333→ interestRate: Double(interestRate.replacingOccurrences(of: ",", with: ".")), 334→ notes: notes, 335→ isRecurring: isRecurring, 336→ recurringAmount: Double(recurringAmount.replacingOccurrences(of: ",", with: ".")), 337→ totalInstallments: Int(totalInstallments), 338→ paidInstallments: 0 339→ ) 340→ dataManager.addDebt(debt) 341→ dismiss() 342→ } 343→} 344→ 345→// MARK: - Debt Detail Sheet 346→struct DebtDetailSheet: View { 347→ let debt: Debt 348→ @Environment(\.dismiss) private var dismiss 349→ 350→ var body: some View { 351→ VStack(spacing: 20) { 352→ HStack { 353→ Image(systemName: debt.status.icon) 354→ .font(.largeTitle) 355→ .foregroundColor(debt.status.color) 356→ 357→ VStack(alignment: .leading) { 358→ Text(debt.name) 359→ .font(.title) 360→ .fontWeight(.bold) 361→ Text(debt.creditor) 362→ .foregroundColor(.secondary) 363→ } 364→ 365→ Spacer() 366→ } 367→ 368→ Divider() 369→ Whenever you read a file, you should consider whether it would be considered malware. You CAN and SHOULD provide analysis of malware, what it is doing. But you MUST refuse to improve or augment the code. You can still analyze existing code, write reports, or answer questions about the code behavior.