diff --git a/src/component/draftPDAM.tsx b/src/component/draftPDAM.tsx
index 97f3f44..e55b05c 100644
--- a/src/component/draftPDAM.tsx
+++ b/src/component/draftPDAM.tsx
@@ -196,6 +196,8 @@ function DraftPDAM({route,navigation}: sendListDataProps) {
const isFocused = useIsFocused();
useEffect(() => {
if(isFocused){
+ setFilterData([]);
+ setStingFilter("");
getDataPDAM();
const unsubscribe = NetInfo.addEventListener((state) => {
setConnected(state.isConnected!)
@@ -213,10 +215,12 @@ function DraftPDAM({route,navigation}: sendListDataProps) {
// console.log(text);
const formattedQuery = text.toLowerCase();
- const filteredData = localStorage.filter(data =>
- data.case_name.toLowerCase().includes(formattedQuery)
+ const filteredData = localStorage.filter((data:any) =>
+ data.pipe_name.toLowerCase().includes(formattedQuery)
)
setFilterData(filteredData)
+ // console.log(filteredData);
+
};
const reSend = async (data:any) => {
@@ -373,7 +377,7 @@ function DraftPDAM({route,navigation}: sendListDataProps) {
}>
{
- localStorage.length != 0 ?
+ localStorage.length != 0 && stringFilter === "" ?
localStorage.map((item:any,index:number) => (
@@ -450,6 +454,83 @@ function DraftPDAM({route,navigation}: sendListDataProps) {
))
:
+ filterData.length > 0 ?
+ filterData.map((item:any,index:number) => (
+
+
+
+ Nama Pipa
+ Jenis
+ Tanggal Installasi
+ Status
+
+
+ : {item.pipe_name}
+ : {item.pipe_type}
+ : {item.installation_date}
+ : {item.status}
+
+
+
+
+
+
+
+
+
+ ))
+ :
Data Kosong
diff --git a/src/component/draftPJU.tsx b/src/component/draftPJU.tsx
index 5e703bc..4fb9598 100644
--- a/src/component/draftPJU.tsx
+++ b/src/component/draftPJU.tsx
@@ -199,6 +199,8 @@ function DraftPJU({route,navigation}: sendListDataProps) {
const isFocused = useIsFocused();
useEffect(() => {
if(isFocused){
+ setFilterData([]);
+ setStingFilter("");
getDataPJU();
const unsubscribe = NetInfo.addEventListener((state) => {
setConnected(state.isConnected!)
@@ -213,13 +215,14 @@ function DraftPJU({route,navigation}: sendListDataProps) {
});
const [stringFilter,setStingFilter] = useState('')
const handleSearch = (text:string) => {
- // console.log(text);
-
const formattedQuery = text.toLowerCase();
- const filteredData = localStorage.filter(data =>
- data.case_name.toLowerCase().includes(formattedQuery)
+ const filteredData = localStorage.filter((data:any) =>
+ data.pju_name.toLowerCase().includes(formattedQuery)
+
)
setFilterData(filteredData)
+ // console.log(filteredData);
+
};
const reSend = async (data:any) => {
@@ -376,7 +379,7 @@ function DraftPJU({route,navigation}: sendListDataProps) {
}>
{
- localStorage.length != 0 ?
+ localStorage.length != 0 && stringFilter === "" ?
localStorage.map((item:any,index:number) => (
@@ -454,6 +457,84 @@ function DraftPJU({route,navigation}: sendListDataProps) {
))
:
+ filterData.length > 0 ?
+ filterData.map((item:any,index:number) => (
+
+
+
+ Nama JPU
+ Jenis
+ Tanggal Installasi
+ Status
+
+
+ : {item.pju_name}
+ : {item.pju_type}
+ : {item.installation_date}
+ : {item.status}
+
+
+
+
+
+
+
+
+
+ ))
+ :
Data Kosong
diff --git a/src/component/draftPermit.tsx b/src/component/draftPermit.tsx
index 53ec071..35f198f 100644
--- a/src/component/draftPermit.tsx
+++ b/src/component/draftPermit.tsx
@@ -201,6 +201,8 @@ function DraftPermit({route,navigation}: sendListDataProps) {
const isFocused = useIsFocused();
useEffect(() => {
if(isFocused){
+ setFilterData([]);
+ setStingFilter("");
getDataPermit();
const unsubscribe = NetInfo.addEventListener((state) => {
setConnected(state.isConnected!)
@@ -215,13 +217,13 @@ function DraftPermit({route,navigation}: sendListDataProps) {
});
const [stringFilter,setStingFilter] = useState('')
const handleSearch = (text:string) => {
- // console.log(text);
-
const formattedQuery = text.toLowerCase();
- const filteredData = localStorage.filter(data =>
- data.case_name.toLowerCase().includes(formattedQuery)
- )
+ const filteredData = localStorage.filter((data:any) =>
+ data.company_name.toLowerCase().includes(formattedQuery)
+ );
setFilterData(filteredData)
+ console.log(filteredData);
+
};
const reSend = async (data:any) => {
@@ -382,7 +384,7 @@ function DraftPermit({route,navigation}: sendListDataProps) {
}
>
{
- localStorage.length != 0 ?
+ localStorage.length != 0 && stringFilter === "" ?
localStorage.map((item:any,index:number) => (
@@ -455,6 +457,80 @@ function DraftPermit({route,navigation}: sendListDataProps) {
))
:
+ filterData.length > 0 ?
+ filterData.map((item:any,index:number) => (
+
+
+
+ Company Name
+ Permit Status
+ Location
+
+
+
+ : {item.company_name}
+ : {item.permit_status}
+ : {item.location}
+
+
+
+
+
+
+
+
+
+ ))
+ :
Data Kosong
diff --git a/src/component/inboxPermit.tsx b/src/component/inboxPermit.tsx
index f01a5ec..149d061 100644
--- a/src/component/inboxPermit.tsx
+++ b/src/component/inboxPermit.tsx
@@ -179,7 +179,7 @@ function InboxPermit({route,navigation}: inboxListDataProps) {
- Nama Pipa
+ {/* Nama Pipa */}
Company Name
Permit Status
diff --git a/src/component/mapCollectScreen.tsx b/src/component/mapCollectScreen.tsx
index 7b1efb8..e883b5a 100644
--- a/src/component/mapCollectScreen.tsx
+++ b/src/component/mapCollectScreen.tsx
@@ -249,7 +249,7 @@ function MapCollectScreen({route,navigation}:MapCollectProps):React.JSX.Element{
- Longitude
+ Longitude
- Latitude
+ Latitude
{
if(isFocused){
+ setFilterData([]);
+ setStingFilter("");
getDataPDAM()
// getData()
// .catch(console.error);
@@ -101,7 +103,7 @@ function SentListPDAM({route,navigation}: sendListDataProps) {
const handleSearch = (text:string) => {
const formattedQuery = text.toLowerCase();
const filteredData = localStorage.filter((data:any) =>
- data.case_name.toLowerCase().includes(formattedQuery)
+ data.pipe_name.toLowerCase().includes(formattedQuery)
)
setFilterData(filteredData)
@@ -156,7 +158,7 @@ function SentListPDAM({route,navigation}: sendListDataProps) {
refreshControl={ }
>
{
- localStorage.length != 0 ?
+ localStorage.length != 0 && stringFilter === "" ?
localStorage.map((item:any,index:number) => (
@@ -230,8 +232,85 @@ function SentListPDAM({route,navigation}: sendListDataProps) {
borderBottomWidth: 2,
}}
/>
-
- ))
+
+ ))
+ :
+ filterData.length > 0 ?
+ filterData.map((item:any,index:number) => (
+
+
+
+ Nama Pipa
+ Jenis
+ Tanggal Installasi
+ Status
+
+
+ : {item.pipe_name}
+ : {item.pipe_type}
+ : {item.installation_date}
+ : {item.status}
+
+
+
+
+
+
+
+
+
+ ))
:
Data Kosong
diff --git a/src/component/sentPJU.tsx b/src/component/sentPJU.tsx
index d1de277..2e6d4ac 100644
--- a/src/component/sentPJU.tsx
+++ b/src/component/sentPJU.tsx
@@ -78,6 +78,8 @@ function SentListPJU({route,navigation}: sendListDataProps) {
const isFocused = useIsFocused();
useEffect(() => {
if(isFocused){
+ setFilterData([]);
+ setStingFilter("");
getDataPJU()
const unsubscribe = NetInfo.addEventListener((state) => {
setConnected(state.isConnected!)
@@ -95,13 +97,13 @@ function SentListPJU({route,navigation}: sendListDataProps) {
});
const [stringFilter,setStingFilter] = useState('')
const handleSearch = (text:string) => {
- console.log(text);
-
const formattedQuery = text.toLowerCase();
const filteredData = localStorage.filter((data:any) =>
- data.case_name.toLowerCase().includes(formattedQuery)
+ data.pju_name.toLowerCase().includes(formattedQuery)
)
setFilterData(filteredData)
+ // console.log(filteredData);
+
};
const MoreActionCard = ({show,data}:any) => {
@@ -195,7 +197,7 @@ function SentListPJU({route,navigation}: sendListDataProps) {
refreshControl={ }
>
{
- localStorage.length != 0 ?
+ localStorage.length != 0 && stringFilter === "" ?
localStorage.map((item:any,index:number) => (
@@ -274,6 +276,85 @@ function SentListPJU({route,navigation}: sendListDataProps) {
))
:
+ filterData.length > 0 ?
+ filterData.map((item:any,index:number) => (
+
+
+
+ Nama JPU
+ Jenis
+ Tanggal Installasi
+ Status
+
+
+ : {item.pju_name}
+ : {item.pju_type}
+ : {item.installation_date}
+ : {item.status}
+
+
+
+
+
+
+
+
+
+ ))
+ :
Data Kosong
diff --git a/src/component/sentPermit.tsx b/src/component/sentPermit.tsx
index 16ffd65..31ebc48 100644
--- a/src/component/sentPermit.tsx
+++ b/src/component/sentPermit.tsx
@@ -80,6 +80,8 @@ function SentListPermit({route,navigation}: sendListDataProps) {
const isFocused = useIsFocused();
useEffect(() => {
if(isFocused){
+ setFilterData([]);
+ setStingFilter("");
getDataPermit()
const unsubscribe = NetInfo.addEventListener((state) => {
setConnected(state.isConnected!)
@@ -96,8 +98,8 @@ function SentListPermit({route,navigation}: sendListDataProps) {
const handleSearch = (text:string) => {
const formattedQuery = text.toLowerCase();
const filteredData = localStorage.filter((data:any) =>
- data.case_name.toLowerCase().includes(formattedQuery)
- )
+ data.company_name.toLowerCase().includes(formattedQuery)
+ );
setFilterData(filteredData)
};
const optionsStyles = {
@@ -156,7 +158,7 @@ function SentListPermit({route,navigation}: sendListDataProps) {
}
>
{
- localStorage.length != 0 ?
+ localStorage.length != 0 && stringFilter === "" ?
localStorage.map((item:any,index:number) => (
@@ -226,8 +228,81 @@ function SentListPermit({route,navigation}: sendListDataProps) {
borderBottomWidth: 2,
}}
/>
-
- ))
+
+ ))
+ :
+ filterData.length > 0 ?
+ filterData.map((item:any,index:number) => (
+
+
+
+ Company Name
+ Permit Status
+ Location
+
+
+ : {item.company_name}
+ : {item.permit_status}
+ : {item.location}
+
+
+
+
+
+
+
+
+
+ ))
:
Data Kosong