thêm toast, thêm logic cho phần ButtonCreateNewHaulOrTrip

This commit is contained in:
Tran Anh Tuan
2025-11-06 17:30:04 +07:00
parent 1ef83c9b22
commit aabd1109b2
15 changed files with 799 additions and 119 deletions

View File

@@ -91,9 +91,9 @@ const NetDetailModal: React.FC<NetDetailModalProps> = ({
}
}, [visible]);
if (!netData) return null;
// if (!netData) return null;
const isCompleted = netData.trangThai === "Đã hoàn thành";
const isCompleted = netData?.trangThai === "Đã hoàn thành";
// Danh sách tên cá có sẵn
const fishNameOptions = [
@@ -210,7 +210,7 @@ const NetDetailModal: React.FC<NetDetailModalProps> = ({
const handleCancel = () => {
setIsEditing(false);
setEditableCatchList(netData.catchList || []);
setEditableCatchList(netData?.catchList || []);
};
const handleToggleExpanded = (index: number) => {
@@ -343,7 +343,10 @@ const NetDetailModal: React.FC<NetDetailModalProps> = ({
{/* Content */}
<ScrollView style={styles.content}>
{/* Thông tin chung */}
<InfoSection netData={netData} isCompleted={isCompleted} />
<InfoSection
netData={netData ?? undefined}
isCompleted={isCompleted}
/>
{/* Danh sách cá bắt được */}
<CatchSectionHeader totalCatch={totalCatch} />
@@ -372,7 +375,7 @@ const NetDetailModal: React.FC<NetDetailModalProps> = ({
/>
{/* Ghi chú */}
<NotesSection ghiChu={netData.ghiChu} />
<NotesSection ghiChu={netData?.ghiChu} />
</ScrollView>
</View>
</Modal>