change fields component & handle edit, delete, add data and save & change functional page doctor
This commit is contained in:
@@ -4,7 +4,7 @@ import { styleTextSelectRight } from "@/mui";
|
||||
function Field({
|
||||
title,
|
||||
error,
|
||||
spaceNull,
|
||||
placeholder,
|
||||
inputProps,
|
||||
type,
|
||||
dir,
|
||||
@@ -21,6 +21,7 @@ function Field({
|
||||
onChange={(e) => updateState(e.target.value)}
|
||||
className="!w-full !mx-auto !bg-[#FFF]"
|
||||
InputProps={inputProps}
|
||||
placeholder={placeholder || ""}
|
||||
sx={{
|
||||
".MuiOutlinedInput-notchedOutline.muirtl-1d3z3hw-MuiOutlinedInput-notchedOutline":
|
||||
{
|
||||
@@ -36,8 +37,8 @@ function Field({
|
||||
MozAppearance: "textfield",
|
||||
},
|
||||
"& .MuiInputBase-input": {
|
||||
padding: spaceNull ? "12.5px 0" : "12.5px 14px",
|
||||
color: spaceNull && "#0009",
|
||||
padding: "12.5px 14px",
|
||||
color: "#0009",
|
||||
},
|
||||
"& .MuiInputBase-root": { borderRadius: "6px !important" },
|
||||
"& .MuiOutlinedInput-notchedOutline": {
|
||||
|
||||
@@ -13,33 +13,17 @@ export default async function Dashboard({ searchParams }) {
|
||||
const ability = defineAbilitiesFor(user);
|
||||
const cookieStore = cookies();
|
||||
const token = cookieStore.get("access_token");
|
||||
const userInfo = cookieStore.get("userInfo");
|
||||
|
||||
if (!ability.can("access", "Dashboard")) {
|
||||
removeToken();
|
||||
return redirect("/login");
|
||||
}
|
||||
|
||||
const response = await fetchReq(
|
||||
`https://back-dev.clinic-pro.ir/api/v1/user-profile/${JSON.parse(userInfo?.value).uuid}`,
|
||||
{
|
||||
headers: {
|
||||
Authorization: `Bearer ${token.value}`,
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
const userAgent = headers().get("user-agent") || "";
|
||||
const isMobile = /Mobi|Android/i.test(userAgent);
|
||||
|
||||
return (
|
||||
<Content
|
||||
dataUser={response}
|
||||
logged={token.value}
|
||||
params={searchParams}
|
||||
matchedCity={matchedCity}
|
||||
initialTurnsDetails={isMobile}
|
||||
userInfo={JSON.parse(userInfo.value || {})}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user