diff --git a/src/screens/Loan/LoanPaidOffLetterOrderDetailsScreen.js b/src/screens/Loan/LoanPaidOffLetterOrderDetailsScreen.js
index d0c554e..07069a2 100644
--- a/src/screens/Loan/LoanPaidOffLetterOrderDetailsScreen.js
+++ b/src/screens/Loan/LoanPaidOffLetterOrderDetailsScreen.js
@@ -6,6 +6,35 @@ import apiService from '../../services/apiService';
import { COLORS } from '../../constants/colors';
import { StatusBar } from 'expo-status-bar';
+// Add helper format functions
+const formatDate = (dateStr) => {
+ if (!dateStr) return '';
+ const d = new Date(dateStr);
+ if (isNaN(d)) return dateStr;
+ return d.toLocaleDateString('tk-TM');
+};
+
+const formatDateTime = (dateStr) => {
+ if (!dateStr) return '';
+ const d = new Date(dateStr);
+ if (isNaN(d)) return dateStr;
+ return d.toLocaleString('tk-TM', {
+ hour: '2-digit',
+ minute: '2-digit',
+ day: '2-digit',
+ month: '2-digit',
+ year: 'numeric',
+ });
+};
+
+// Inline component for a key/value row
+const DetailRow = ({ label, value, showBorder = true }) => (
+
+ {label}
+ {String(value)}
+
+);
+
const LoanPaidOffLetterOrderDetailsScreen = () => {
const navigation = useNavigation();
const route = useRoute();
@@ -71,55 +100,50 @@ const LoanPaidOffLetterOrderDetailsScreen = () => {
- Güwanama {order.id}
+ Karzyň ýapylandygy barada güwanama maglumatlary
+ {/* Basic order info */}
- {[
- 'id',
- 'region',
- 'branch_id',
- 'customer_name',
- 'customer_surname',
- 'customer_patronic_name',
- 'born_at',
- 'phone',
- 'passport_serie',
- 'passport_id',
- 'status',
- 'notes',
- 'loan_contract_number',
- 'loan_contract_date',
- 'loan_amount',
- 'loan_reason',
- ].filter((k) => order[k] !== undefined && order[k] !== null).map((key, idx, arr) => {
- const titles = {
- id: 'ID',
- region: 'Welaýat',
- branch_id: 'Şahamça',
- customer_name: 'Ady',
- customer_surname: 'Familiýasy',
- customer_patronic_name: 'Atasynyň ady',
- born_at: 'Doglan senesi',
- phone: 'Telefon',
- passport_serie: 'Passport seriýa',
- passport_id: 'Passport nomer',
- status: 'Status',
- notes: 'Bellikler',
- loan_contract_number: 'Karz şertnamanyň belgisi',
- loan_contract_date: 'Karz şertnamanyň senesi',
- loan_amount: 'Karzyň möçberi',
- loan_reason: 'Karzyň maksady',
- };
- return (
-
- {titles[key]}
- {String(order[key])}
-
- );
- })}
+
+ {order.created_at && (
+
+ )}
+ {order.status && }
+ {}
+
+
+ {/* Lokasiýa */}
+ {(order.region || order.branch_id) && (
+ <>
+ Lokasiýa
+
+ {order.region && }
+ {order.branch_id && }
+
+ >
+ )}
+
+ {/* Şahsy maglumatlar */}
+ Şahsy maglumatlar
+
+
+ {order.born_at && (
+
+ )}
+ {order.phone && }
+ {order.passport_serie && }
+ {order.passport_id && }
+
+
+ {/* Karz barada maglumatlar */}
+ Karz barada maglumatlar
+
+ {order.loan_contract_number && }
+ {order.loan_contract_date && (
+
+ )}
+ {order.loan_amount && }
+ {order.loan_reason && }
@@ -188,6 +212,12 @@ const styles = StyleSheet.create({
fontSize: 16,
fontWeight: '600',
},
+ sectionTitle: {
+ fontSize: 18,
+ fontWeight: '700',
+ color: COLORS.textPrimary,
+ marginBottom: 12,
+ },
});
export default LoanPaidOffLetterOrderDetailsScreen;
\ No newline at end of file