add en/vi language
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { IconSymbol } from "@/components/ui/icon-symbol";
|
||||
import { useI18n } from "@/hooks/use-i18n";
|
||||
import { useFishes } from "@/state/use-fish";
|
||||
import { useTrip } from "@/state/use-trip";
|
||||
import React, { useEffect, useRef, useState } from "react";
|
||||
@@ -12,6 +13,7 @@ const NetListTable: React.FC = () => {
|
||||
const animatedHeight = useRef(new Animated.Value(0)).current;
|
||||
const [modalVisible, setModalVisible] = useState(false);
|
||||
const [selectedNet, setSelectedNet] = useState<Model.FishingLog | null>(null);
|
||||
const { t } = useI18n();
|
||||
const { trip } = useTrip();
|
||||
const { fishSpecies, getFishSpecies } = useFishes();
|
||||
useEffect(() => {
|
||||
@@ -49,7 +51,7 @@ const NetListTable: React.FC = () => {
|
||||
onPress={handleToggle}
|
||||
style={styles.headerRow}
|
||||
>
|
||||
<Text style={styles.title}>Danh sách mẻ lưới</Text>
|
||||
<Text style={styles.title}>{t("trip.netList.title")}</Text>
|
||||
{collapsed && (
|
||||
<Text style={styles.totalCollapsed}>
|
||||
{trip?.fishing_logs?.length}
|
||||
@@ -84,15 +86,21 @@ const NetListTable: React.FC = () => {
|
||||
>
|
||||
{/* Header */}
|
||||
<View style={[styles.row, styles.tableHeader]}>
|
||||
<Text style={[styles.sttCell, styles.headerText]}>STT</Text>
|
||||
<Text style={[styles.cell, styles.headerText]}>Trạng thái</Text>
|
||||
<Text style={[styles.sttCell, styles.headerText]}>
|
||||
{t("trip.netList.sttHeader")}
|
||||
</Text>
|
||||
<Text style={[styles.cell, styles.headerText]}>
|
||||
{t("trip.netList.statusHeader")}
|
||||
</Text>
|
||||
</View>
|
||||
|
||||
{/* Body */}
|
||||
{trip?.fishing_logs?.map((item, index) => (
|
||||
<View key={item.fishing_log_id} style={styles.row}>
|
||||
{/* Cột STT */}
|
||||
<Text style={styles.sttCell}>Mẻ {index + 1}</Text>
|
||||
<Text style={styles.sttCell}>
|
||||
{t("trip.netList.haulPrefix")} {index + 1}
|
||||
</Text>
|
||||
|
||||
{/* Cột Trạng thái */}
|
||||
<View style={[styles.cell, styles.statusContainer]}>
|
||||
@@ -106,7 +114,9 @@ const NetListTable: React.FC = () => {
|
||||
onPress={() => handleStatusPress(item.fishing_log_id)}
|
||||
>
|
||||
<Text style={styles.statusText}>
|
||||
{item.status ? "Đã hoàn thành" : "Chưa hoàn thành"}
|
||||
{item.status
|
||||
? t("trip.netList.completed")
|
||||
: t("trip.netList.pending")}
|
||||
</Text>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
@@ -118,15 +128,21 @@ const NetListTable: React.FC = () => {
|
||||
<Animated.View style={{ height: animatedHeight, overflow: "hidden" }}>
|
||||
{/* Header */}
|
||||
<View style={[styles.row, styles.tableHeader]}>
|
||||
<Text style={[styles.sttCell, styles.headerText]}>STT</Text>
|
||||
<Text style={[styles.cell, styles.headerText]}>Trạng thái</Text>
|
||||
<Text style={[styles.sttCell, styles.headerText]}>
|
||||
{t("trip.netList.sttHeader")}
|
||||
</Text>
|
||||
<Text style={[styles.cell, styles.headerText]}>
|
||||
{t("trip.netList.statusHeader")}
|
||||
</Text>
|
||||
</View>
|
||||
|
||||
{/* Body */}
|
||||
{trip?.fishing_logs?.map((item, index) => (
|
||||
<View key={item.fishing_log_id} style={styles.row}>
|
||||
{/* Cột STT */}
|
||||
<Text style={styles.sttCell}>Mẻ {index + 1}</Text>
|
||||
<Text style={styles.sttCell}>
|
||||
{t("trip.netList.haulPrefix")} {index + 1}
|
||||
</Text>
|
||||
|
||||
{/* Cột Trạng thái */}
|
||||
<View style={[styles.cell, styles.statusContainer]}>
|
||||
@@ -140,7 +156,9 @@ const NetListTable: React.FC = () => {
|
||||
onPress={() => handleStatusPress(item.fishing_log_id)}
|
||||
>
|
||||
<Text style={styles.statusText}>
|
||||
{item.status ? "Đã hoàn thành" : "Chưa hoàn thành"}
|
||||
{item.status
|
||||
? t("trip.netList.completed")
|
||||
: t("trip.netList.pending")}
|
||||
</Text>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
|
||||
Reference in New Issue
Block a user