import { Ionicons } from "@expo/vector-icons"; import { useNavigation } from "@react-navigation/native"; import { Body, H3, Icon, ListItem, Right } from "native-base"; import React, { useRef } from "react"; import { useTranslation } from "react-i18next"; import { Animated, Text } from "react-native"; import { TouchableOpacity } from "react-native-gesture-handler"; import Swipeable from "react-native-gesture-handler/Swipeable"; import { connect } from "react-redux"; import { createStructuredSelector } from "reselect"; import { logImEXEvent } from "../../firebase/firebase.utils"; import { setCameraJob, setCameraJobId } from "../../redux/app/app.actions"; import styles from "../styles"; const mapStateToProps = createStructuredSelector({}); const mapDispatchToProps = (dispatch) => ({ setCameraJobId: (id) => dispatch(setCameraJobId(id)), setCameraJob: (job) => dispatch(setCameraJob(job)), }); export function JobListItem({ setCameraJob, setCameraJobId, item }) { const { t } = useTranslation(); const navigation = useNavigation(); const _swipeableRow = useRef(null); const RenderRightAction = (progress, dragX) => { const scale = dragX.interpolate({ inputRange: [-100, 0], outputRange: [0.7, 0], }); return ( { logImEXEvent("imexmobile_setcamerajobid_swipe"); setCameraJobId(item.id); setCameraJob(item); navigation.navigate("MediaBrowserTab"); _swipeableRow.current.close(); }} > ); }; const onPress = () => { logImEXEvent("imexmobile_view_job_detail"); navigation.push("JobDetail", { jobId: item.id, title: item.ro_number || t("general.labels.na"), }); }; return (

{item.ro_number || t("general.labels.na")}

{`${item.ownr_fn || ""} ${item.ownr_ln || ""} ${ item.ownr_co_nm || "" } - ${item.v_model_yr || ""} ${item.v_make_desc || ""} ${ item.v_model_desc || "" }`}
); } export default connect(mapStateToProps, mapDispatchToProps)(JobListItem);