diff --git a/src/components/AddStationLocation/addStationLocation.tsx b/src/components/AddStationLocation/addStationLocation.tsx new file mode 100644 index 0000000..a735b63 --- /dev/null +++ b/src/components/AddStationLocation/addStationLocation.tsx @@ -0,0 +1,76 @@ +import { + Dialog, + DialogActions, + DialogContent, + DialogTitle, + Button, + TextField, +} from "@mui/material"; +import { useForm, SubmitHandler } from "react-hook-form"; + +interface FormValues { + city: string; +} + +const AddStationLocationModal = ({ + open, + handleClose, + handleAddStation, +}: any) => { + const { + register, + handleSubmit, + reset, + formState: { errors }, + } = useForm(); + + const onSubmit: SubmitHandler = (data) => { + handleAddStation(data); + reset(); + handleClose(); + }; + + return ( + + Search Near By Stations + +
+ + + + + + +
+
+ ); +}; + +export default AddStationLocationModal; diff --git a/src/components/CustomTable/customTable.tsx b/src/components/CustomTable/customTable.tsx index f5663de..7c13c38 100644 --- a/src/components/CustomTable/customTable.tsx +++ b/src/components/CustomTable/customTable.tsx @@ -85,7 +85,7 @@ interface CustomTableProps { deleteModal: boolean; handleStatusToggle?: (id: string, currentStatus: number) => void; tableType: string; // Adding tableType prop to change header text dynamically - handleClickOpen: () => void; + handleClickOpen?: () => void; } const CustomTable: React.FC = ({ @@ -207,6 +207,7 @@ const CustomTable: React.FC = ({ (row) => (row.name && row.name.toLowerCase().includes(searchQuery.toLowerCase())) || + row.registeredAddress.toLowerCase().includes(searchQuery.toLowerCase()) || false ); @@ -254,6 +255,8 @@ const CustomTable: React.FC = ({ return "Vehicles"; case "station": return "Charging Station"; + case "external-station": + return "Charging Station"; case "booking": return "Booking"; case "slots": @@ -318,7 +321,9 @@ const CustomTable: React.FC = ({ width: "100%", }} > - {!(user?.userType === "user" && tableType === "slots") && ( + {!( + user?.userType === "user" && + (tableType === "slots" )) && (