dev-jaanvi #1
|
@ -83,31 +83,42 @@ export default function VehicleViewModal({ open, setViewModal, id }: Props) {
|
||||||
<Grid container spacing={2} sx={{ width: "80%" }}>
|
<Grid container spacing={2} sx={{ width: "80%" }}>
|
||||||
<Grid item xs={6}>
|
<Grid item xs={6}>
|
||||||
<Typography variant="body1">
|
<Typography variant="body1">
|
||||||
<strong>Name:</strong> {selectedVehicle.name}
|
<strong>Name:</strong>{" "}
|
||||||
|
<Typography variant="body2">
|
||||||
|
{selectedVehicle.name}
|
||||||
|
</Typography>
|
||||||
</Typography>
|
</Typography>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={6}>
|
<Grid item xs={6}>
|
||||||
<Typography variant="body1">
|
<Typography variant="body1">
|
||||||
<strong>Company:</strong>{" "}
|
<strong>Company:</strong>{" "}
|
||||||
{selectedVehicle.company}
|
<Typography variant="body2">
|
||||||
|
{selectedVehicle.company}
|
||||||
|
</Typography>
|
||||||
</Typography>
|
</Typography>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={6}>
|
<Grid item xs={6}>
|
||||||
<Typography variant="body1">
|
<Typography variant="body1">
|
||||||
<strong>Model Name:</strong>{" "}
|
<strong>Model Name:</strong>
|
||||||
{selectedVehicle.modelName}
|
<Typography variant="body2">
|
||||||
|
{selectedVehicle.modelName}
|
||||||
|
</Typography>
|
||||||
</Typography>
|
</Typography>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={6}>
|
<Grid item xs={6}>
|
||||||
<Typography variant="body1">
|
<Typography variant="body1">
|
||||||
<strong>Charge Type:</strong>{" "}
|
<strong>Charge Type:</strong>
|
||||||
{selectedVehicle.chargeType}
|
<Typography variant="body2">
|
||||||
|
{selectedVehicle.chargeType}
|
||||||
|
</Typography>
|
||||||
</Typography>
|
</Typography>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={6}>
|
<Grid item xs={6}>
|
||||||
<Typography variant="body1">
|
<Typography variant="body1">
|
||||||
<strong>Image URL:</strong>{" "}
|
<strong>Image URL:</strong>
|
||||||
{selectedVehicle.imageUrl}
|
<Typography variant="body2">
|
||||||
|
{selectedVehicle.imageUrl ?? "N/A"}
|
||||||
|
</Typography>
|
||||||
</Typography>
|
</Typography>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
|
@ -10,14 +10,12 @@ type Props = {
|
||||||
id?: string;
|
id?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
const mainContainerStyle = {
|
const style = {
|
||||||
position: "absolute",
|
position: "absolute",
|
||||||
top: "50%",
|
top: "50%",
|
||||||
left: "50%",
|
left: "50%",
|
||||||
transform: "translate(-50%, -50%)",
|
transform: "translate(-50%, -50%)",
|
||||||
// width: "544px",
|
width: 400,
|
||||||
// height: "190px",
|
|
||||||
gap: "8px",
|
|
||||||
bgcolor: "background.paper",
|
bgcolor: "background.paper",
|
||||||
borderRadius: 2,
|
borderRadius: 2,
|
||||||
boxShadow: "0px 4px 20px rgba(0, 0, 0, 0.15)",
|
boxShadow: "0px 4px 20px rgba(0, 0, 0, 0.15)",
|
||||||
|
@ -25,16 +23,7 @@ const mainContainerStyle = {
|
||||||
display: "flex",
|
display: "flex",
|
||||||
flexDirection: "column",
|
flexDirection: "column",
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
};
|
gap: 2,
|
||||||
|
|
||||||
const headerLayoutStyle = {
|
|
||||||
// width: 544,
|
|
||||||
// height: 48,
|
|
||||||
gap: "24px",
|
|
||||||
paddingBottom: "12px",
|
|
||||||
display: "flex",
|
|
||||||
alignItems: "center",
|
|
||||||
justifyContent: "space-between",
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function ViewModal({ open, setViewModal, id }: Props) {
|
export default function ViewModal({ open, setViewModal, id }: Props) {
|
||||||
|
@ -54,74 +43,69 @@ export default function ViewModal({ open, setViewModal, id }: Props) {
|
||||||
aria-labelledby="modal-title"
|
aria-labelledby="modal-title"
|
||||||
aria-describedby="modal-description"
|
aria-describedby="modal-description"
|
||||||
>
|
>
|
||||||
<Box sx={mainContainerStyle}>
|
<Box sx={style}>
|
||||||
<Box sx={headerLayoutStyle}>
|
<Typography
|
||||||
<Typography
|
id="modal-title"
|
||||||
id="modal-title"
|
variant="h5"
|
||||||
variant="h5"
|
fontWeight="bold"
|
||||||
fontWeight="bold"
|
sx={{ width: "100%" }}
|
||||||
sx={{ flex: 1, textAlign: "center" }}
|
>
|
||||||
>
|
|
||||||
{selectedAdmin?.name}'s Details
|
|
||||||
</Typography>
|
|
||||||
<Box
|
<Box
|
||||||
onClick={() => setViewModal(false)}
|
|
||||||
sx={{
|
sx={{
|
||||||
cursor: "pointer",
|
|
||||||
display: "flex",
|
display: "flex",
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
marginLeft: "auto", // Ensures the button is at the right end
|
justifyContent: "space-between",
|
||||||
justifyContent:"flex-end"
|
width: "100%",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<CloseIcon />
|
<Box sx={{ flex: 1, textAlign: "center" }}>
|
||||||
|
{selectedAdmin?.name || "Admin"}'s Details
|
||||||
|
</Box>
|
||||||
|
<Box
|
||||||
|
onClick={() => setViewModal(false)}
|
||||||
|
sx={{
|
||||||
|
cursor: "pointer",
|
||||||
|
display: "flex",
|
||||||
|
alignItems: "center",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<CloseIcon />
|
||||||
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
</Box>
|
</Typography>
|
||||||
|
|
||||||
<Divider sx={{ width: "100%" }} />
|
<Divider sx={{ width: "100%" }} />
|
||||||
|
|
||||||
{selectedAdmin ? (
|
{selectedAdmin ? (
|
||||||
<Box
|
<Grid container spacing={2} sx={{ width: "80%" }}>
|
||||||
sx={{
|
<Grid item xs={6}>
|
||||||
width: "100%",
|
<Typography variant="body1">
|
||||||
textAlign: "left",
|
<strong>Name:</strong>
|
||||||
display: "flex",
|
<Typography variant="body2">
|
||||||
flexDirection: "column",
|
{selectedAdmin.name}
|
||||||
gap: 1.5,
|
|
||||||
whiteSpace: "pre-wrap",
|
|
||||||
wordBreak: "break-word",
|
|
||||||
overflowWrap: "break-word",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Grid container spacing={2}>
|
|
||||||
<Grid item xs={6}>
|
|
||||||
<Typography>
|
|
||||||
<b>Name:</b>
|
|
||||||
</Typography>
|
</Typography>
|
||||||
<Typography>{selectedAdmin.name}</Typography>
|
</Typography>
|
||||||
</Grid>
|
|
||||||
<Grid item xs={6}>
|
|
||||||
<Typography>
|
|
||||||
<b>Phone:</b>
|
|
||||||
</Typography>
|
|
||||||
<Typography>{selectedAdmin.phone}</Typography>
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={6}>
|
|
||||||
<Typography>
|
|
||||||
<b>Email:</b>
|
|
||||||
</Typography>
|
|
||||||
<Typography>{selectedAdmin.email}</Typography>
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={6}>
|
|
||||||
<Typography>
|
|
||||||
<b>Address:</b>
|
|
||||||
</Typography>
|
|
||||||
<Typography>
|
|
||||||
{selectedAdmin.registeredAddress ?? "N/A"}
|
|
||||||
</Typography>
|
|
||||||
</Grid>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Box>
|
<Grid item xs={6}>
|
||||||
|
<Typography variant="body1">
|
||||||
|
<strong>Phone:</strong>
|
||||||
|
<Typography variant="body2">{selectedAdmin.phone}</Typography>
|
||||||
|
</Typography>
|
||||||
|
</Grid>
|
||||||
|
<Grid item xs={6}>
|
||||||
|
<Typography variant="body1">
|
||||||
|
<strong>Email:</strong>
|
||||||
|
<Typography variant="body2">{selectedAdmin.email}</Typography>
|
||||||
|
</Typography>
|
||||||
|
</Grid>
|
||||||
|
<Grid item xs={6}>
|
||||||
|
<Typography variant="body1">
|
||||||
|
<strong>Address:</strong>
|
||||||
|
|
||||||
|
<Typography variant="body2">{selectedAdmin.registeredAddress ?? "N/A"}</Typography>
|
||||||
|
</Typography>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
) : (
|
) : (
|
||||||
<Typography align="center">
|
<Typography align="center">
|
||||||
No admin found with this ID
|
No admin found with this ID
|
||||||
|
|
Loading…
Reference in a new issue