thêm toast, thêm logic cho phần ButtonCreateNewHaulOrTrip
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user