import { Formik } from "formik"; import React, { useEffect, useState } from "react"; import { StyleSheet, Text, View, ScrollView } from "react-native"; import { useTranslation } from "react-i18next"; import { connect } from "react-redux"; import { createStructuredSelector } from "reselect"; import { Button, Dialog, TextInput } from "react-native-paper"; import { CostCenterSelect } from "../Selects/select-cost-center"; import { JobIdSearchSelect } from "../Selects/select-job-id"; import DateTimePickerModal from "react-native-modal-datetime-picker"; import { selectCurrentEmployee, selectRates, } from "../../redux/employee/employee.selectors"; import { selectBodyshop } from "../../redux/user/user.selectors"; import { useCallback } from "react"; // import LaborAllocationsTable from "../labor-allocations-table/labor-allocations-table.component"; import LaborAllocationsTable from "../labor-allocations-table/labor-allocations-table.component"; import ErrorDisplay from "../error-display/error-display.component"; //TODO add props needed for call const mapStateToProps = createStructuredSelector({ currentEmployee: selectCurrentEmployee, currentRatesNCostCenters: selectRates, currentBodyshop: selectBodyshop, }); // const mapDispatchToProps = (dispatch) => ({}); export function TimeTicketCreate({ currentEmployee, currentRatesNCostCenters, currentBodyshop, }) { const { t } = useTranslation(); const [isDatePickerVisible, setDatePickerVisibility] = useState(false); const [date2, setDate2] = useState(new Date()); const [currentSCC, setCurrentSCC] = useState(null); // const [currentSJob, setCurrentSJob] = useState(null); const [currentSJobId, setCurrentSJobId] = useState(null); // const wrapperSetCurrentSJobState = useCallback( // (val) => { // setCurrentSJob(val); // }, // [setCurrentSJob] // ); const showDatePicker = () => { setDatePickerVisibility(true); }; const hideDatePicker = () => { setDatePickerVisibility(false); }; const handleConfirm = (date) => { setDate2(date); //console.war1n("A date has been picked: ", date); hideDatePicker(); }; const formSubmit = (values) => { console.log("values", values); //Dialog.alert({ content:
{JSON.stringify(values, null, 2)} });
//TODO update with start call for create time ticket
};
return (