dashboard design and functionality and data and page doctor and clinic change data

This commit is contained in:
Ehsan
2025-06-04 03:58:38 +03:30
parent dafeebc54f
commit 0a8874c4ab
18 changed files with 419 additions and 102 deletions
-2
View File
@@ -1,6 +1,5 @@
import axios from "axios";
import BlogPage from "@/components/blog";
import articles from "@/data/articles.json";
import Layout from "@/components/layout/StLayout";
async function Blog({ params: { slug } }) {
@@ -11,7 +10,6 @@ async function Blog({ params: { slug } }) {
const resBlog = blog.data;
const resBlogs = blogs.data;
console.log(resBlogs);
return (
<Layout>
+1 -1
View File
@@ -20,7 +20,7 @@ function EditField({
<TextField
{...props}
rows={multiline}
value={data?.value}
value={data?.value || ""}
multiline={multiline}
type={type || "text"}
placeholder={placeholder || ""}
+1 -1
View File
@@ -17,7 +17,7 @@ function AutoSelector({
disablePortal
options={list}
disabled={disabled}
defaultValue={value}
defaultValue={value || ""}
ListboxProps={listboxProps}
getOptionLabel={(option) => {
if (typeof option === "string") return option;
+13 -1
View File
@@ -2,6 +2,7 @@ import Content from "@/components/dashboard/Content";
import { defineAbilitiesFor } from "@/lib/ability";
import { getUser } from "@/lib/auth";
import { getStateInfo } from "@/lib/getStateInfo";
import axios from "axios";
import { cookies, headers } from "next/headers";
import { redirect } from "next/navigation";
@@ -11,6 +12,16 @@ export default async function Dashboard() {
const ability = defineAbilitiesFor(user);
const cookieStore = cookies();
const token = cookieStore.get("access_token");
const uuid = "9ef7c050-6e81-4aa2-8248-283a16635624";
const response = await axios.get(
`https://back-dev.clinic-pro.ir/api/v1/user-profile/9ef7c050-6e81-4aa2-8248-283a16635624`,
{
headers: {
Authorization: `Bearer ${token.value}`,
},
}
);
const dashboard = response.data;
if (!ability.can("access", "Dashboard")) {
return redirect("/");
@@ -21,8 +32,9 @@ export default async function Dashboard() {
return (
<Content
matchedCity={matchedCity}
logged={token}
dataUser={dashboard}
matchedCity={matchedCity}
initialTurnsDetails={isMobile}
/>
);