- {value === index && (
-
- {children}
-
- )}
+
+ {value === index && {children}}
);
}
-const CreateDialog = ({open, setOpen, mutate}) => {
+const CreateDialog = ({ open, setOpen, mutate }) => {
const theme = useTheme();
const isMobile = useMediaQuery(theme.breakpoints.down("sm"));
const [tabState, setTabState] = useState(0);
@@ -55,7 +48,7 @@ const CreateDialog = ({open, setOpen, mutate}) => {
if (tabState === 0) {
handleClose();
} else {
- setTabState(tabState - 1)
+ setTabState(tabState - 1);
}
};
@@ -72,7 +65,7 @@ const CreateDialog = ({open, setOpen, mutate}) => {
request_date: string().required("تاریخ درخواست را وارد کنید!"),
report_date: string().required("تاریخ گزارش را وارد کنید!"),
});
- const requestServer = useRequest({auth: true});
+ const requestServer = useRequest({ auth: true });
const defaultValues = {
azmayesh_type_id: "",
@@ -95,8 +88,8 @@ const CreateDialog = ({open, setOpen, mutate}) => {
register,
handleSubmit,
setValue,
- formState: {isSubmitting, errors, touchedFields},
- } = useForm({defaultValues, resolver: yupResolver(validationSchema), mode: "onBlur"});
+ formState: { isSubmitting, errors, touchedFields },
+ } = useForm({ defaultValues, resolver: yupResolver(validationSchema), mode: "onBlur" });
const onSubmit = async (data) => {
const formData = new FormData();
@@ -123,59 +116,78 @@ const CreateDialog = ({open, setOpen, mutate}) => {
mutate();
handleClose();
})
- .catch(() => {
- });
+ .catch(() => {});
};
return (
diff --git a/src/components/dashboard/azmayesh/Actions/Create/index.jsx b/src/components/dashboard/azmayesh/Actions/Create/index.jsx
index 1dae100..88de5f6 100644
--- a/src/components/dashboard/azmayesh/Actions/Create/index.jsx
+++ b/src/components/dashboard/azmayesh/Actions/Create/index.jsx
@@ -1,12 +1,12 @@
"use client";
-import {Button, IconButton, useMediaQuery} from "@mui/material";
-import {useTheme} from "@emotion/react";
-import {useState} from "react";
-import {AddCircle} from "@mui/icons-material";
+import { Button, IconButton, useMediaQuery } from "@mui/material";
+import { useTheme } from "@emotion/react";
+import { useState } from "react";
+import { AddCircle } from "@mui/icons-material";
import CreateDialog from "./CreateDialog";
-const AzmayeshCreate = ({mutate}) => {
+const AzmayeshCreate = ({ mutate }) => {
const theme = useTheme();
const isMobile = useMediaQuery(theme.breakpoints.down("sm"));
const [open, setOpen] = useState(false);
@@ -19,14 +19,14 @@ const AzmayeshCreate = ({mutate}) => {
<>
{isMobile ? (
-
+
) : (
-
} onClick={handleOpen}>
+ } onClick={handleOpen}>
ثبت آزمایش
)}
- {open &&
}
+ {open && }
>
);
};
diff --git a/src/components/dashboard/azmayesh/AzmayeshList.jsx b/src/components/dashboard/azmayesh/AzmayeshList.jsx
index 8fd735f..f9b30c5 100644
--- a/src/components/dashboard/azmayesh/AzmayeshList.jsx
+++ b/src/components/dashboard/azmayesh/AzmayeshList.jsx
@@ -1,10 +1,10 @@
"use client";
-import {useMemo} from "react";
-import {Box, Typography} from "@mui/material";
+import { useMemo } from "react";
+import { Box, Typography } from "@mui/material";
import DataTableWithAuth from "@/core/components/DataTableWithAuth";
import Toolbar from "./Toolbar";
-import {GET_AZMAYESH_LIST} from "@/core/utils/routes";
+import { GET_AZMAYESH_LIST } from "@/core/utils/routes";
import moment from "jalali-moment";
import ShowLocation from "./ShowLocation";
@@ -42,7 +42,7 @@ const AzmayeshList = () => {
enableColumnFilter: false,
datatype: "text",
filterFn: "equals",
- Cell: ({row}) => (),
+ Cell: ({ row }) => ,
},
{
accessorKey: "employer",
@@ -99,8 +99,11 @@ const AzmayeshList = () => {
enableColumnFilter: false,
datatype: "date",
filterFn: "equals",
- Cell: ({renderedCellValue}) => ({moment(renderedCellValue).locale("fa").format("YYYY/MM/DD")}),
+ Cell: ({ renderedCellValue }) => (
+
+ {moment(renderedCellValue).locale("fa").format("YYYY/MM/DD")}
+
+ ),
},
{
accessorKey: "report_date",
@@ -109,8 +112,11 @@ const AzmayeshList = () => {
enableColumnFilter: false,
datatype: "date",
filterFn: "equals",
- Cell: ({renderedCellValue}) => ({moment(renderedCellValue).locale("fa").format("YYYY/MM/DD")}),
+ Cell: ({ renderedCellValue }) => (
+
+ {moment(renderedCellValue).locale("fa").format("YYYY/MM/DD")}
+
+ ),
},
],
[]
@@ -118,7 +124,7 @@ const AzmayeshList = () => {
return (
<>
-
+
{
+const ShowLocationMarker = ({ lat, lng }) => {
const map = useMap();
const theme = useTheme();
const isMobile = useMediaQuery(theme.breakpoints.down("sm"));
@@ -19,35 +19,36 @@ const ShowLocationMarker = ({lat, lng}) => {
iconUrl: iconUrl,
iconSize: size,
iconAnchor: [size[0] / 2, size[1]],
- popupAnchor: [0, -size[1]]
+ popupAnchor: [0, -size[1]],
});
};
useEffect(() => {
- map.flyTo({lat: lat, lng: lng}, 14);
+ map.flyTo({ lat: lat, lng: lng }, 14);
}, []);
-
return (
<>
-
-
+
+
-
+
طول جغرافیایی
{
size="small"
readOnly
sx={{
- '& .MuiOutlinedInput-notchedOutline': {
+ "& .MuiOutlinedInput-notchedOutline": {
borderColor: "success.main",
},
- color: "success.main"
+ color: "success.main",
}}
value={lat}
endAdornment={
-
+
}
label="طول جغرافیایی"
/>
-
+
عرض جغرافیایی
{
size="small"
readOnly
sx={{
- '& .MuiOutlinedInput-notchedOutline': {
+ "& .MuiOutlinedInput-notchedOutline": {
borderColor: "success.main",
},
- color: "success.main"
+ color: "success.main",
}}
value={lng}
endAdornment={
-
+
}
label="عرض جغرافیایی"
@@ -100,4 +101,4 @@ const ShowLocationMarker = ({lat, lng}) => {
);
};
-export default ShowLocationMarker;
\ No newline at end of file
+export default ShowLocationMarker;
diff --git a/src/components/dashboard/azmayesh/ShowLocation/index.jsx b/src/components/dashboard/azmayesh/ShowLocation/index.jsx
index 557a780..c260da7 100644
--- a/src/components/dashboard/azmayesh/ShowLocation/index.jsx
+++ b/src/components/dashboard/azmayesh/ShowLocation/index.jsx
@@ -1,18 +1,18 @@
"use client";
import ExploreIcon from "@mui/icons-material/Explore";
-import {Box, Button, Dialog, DialogActions, DialogContent, IconButton} from "@mui/material";
-import {useState} from "react";
+import { Box, Button, Dialog, DialogActions, DialogContent, IconButton } from "@mui/material";
+import { useState } from "react";
import dynamic from "next/dynamic";
import MapLoading from "@/core/components/MapLayer/Loading";
import ShowLocationMarker from "./ShowLocationMarker";
const MapLayer = dynamic(() => import("@/core/components/MapLayer"), {
- loading: () => ,
+ loading: () => ,
ssr: false,
});
-const ShowLocation = ({lat, lng}) => {
+const ShowLocation = ({ lat, lng }) => {
const [openShowLocationModal, setOpenShowLocationModal] = useState(false);
const handleOpenShowLocationModal = () => {
@@ -24,17 +24,19 @@ const ShowLocation = ({lat, lng}) => {
};
return (
-
-
+
+
+
+