diff --git a/app/component/TimePickerField.js b/app/component/TimePickerField.js
index ed135c2..4f898fd 100644
--- a/app/component/TimePickerField.js
+++ b/app/component/TimePickerField.js
@@ -69,7 +69,7 @@ function TimePickerField({ dataChange, isVacation, disable, timeStart, data }) {
}}
/>
diff --git a/app/component/UploadFile.js b/app/component/UploadFile.js
index 997f2c8..52d8c0b 100644
--- a/app/component/UploadFile.js
+++ b/app/component/UploadFile.js
@@ -4,21 +4,42 @@ import { useRef } from "react";
import { Button } from "@mui/material";
import ProfileP from "@/components/icons/ProfileP";
import ArrowLeftPU from "@/components/icons/ArrowLeftPU";
+import { uploadImage } from "@/helper";
+import Image from "next/image";
-function UploadFile() {
+function UploadFile({ image, setImage }) {
const fileRef = useRef();
const openInput = () => fileRef.current.click();
+ const handleChange = async (e) => {
+ const result = await uploadImage(event);
+ setImage(result);
+ };
return (
<>
-
-
+
+ {image && image.blob ? (
+
+ ) : (
+
+ )}
diff --git a/components/panel/addDoctor/listMenu/workingDays/modal/Form.js b/components/panel/addDoctor/listMenu/workingDays/modal/Form.js
index 481c683..bbb0e62 100644
--- a/components/panel/addDoctor/listMenu/workingDays/modal/Form.js
+++ b/components/panel/addDoctor/listMenu/workingDays/modal/Form.js
@@ -77,14 +77,14 @@ function Form({
انصراف
ذخیره
diff --git a/components/panel/turns/head/SearchDoctor.js b/components/panel/turns/head/SearchDoctor.js
index c16b66c..9450f02 100644
--- a/components/panel/turns/head/SearchDoctor.js
+++ b/components/panel/turns/head/SearchDoctor.js
@@ -40,7 +40,7 @@ function SearchDoctor() {
خروجی گرفتن
diff --git a/components/panel/userAccount/account/Head.js b/components/panel/userAccount/account/Head.js
index 076d97b..4f7dc12 100644
--- a/components/panel/userAccount/account/Head.js
+++ b/components/panel/userAccount/account/Head.js
@@ -1,11 +1,17 @@
"use client";
import UploadFile from "@/app/component/UploadFile";
+import { useState } from "react";
function Head() {
+ const [image, setImage] = useState({
+ file: "",
+ blob: "",
+ });
+
return (
-
+
);
}
diff --git a/components/panel/userAccount/bank/cards/Item.js b/components/panel/userAccount/bank/cards/Item.js
index 9f68e83..e80f3cc 100644
--- a/components/panel/userAccount/bank/cards/Item.js
+++ b/components/panel/userAccount/bank/cards/Item.js
@@ -6,12 +6,12 @@ import { Button } from "@mui/material";
function Item({ data, loading }) {
return (
-
+
-
+
{data.status ? "فعال" : "غیر فعال"}
@@ -30,34 +30,38 @@ function Item({ data, loading }) {
-
-
+
شماره کارت:
-
+
{data.card_number}
-
+
-
-
شماره شبا:
+
+ شماره شبا:
+
-
+
{data.shaba_number}
-
+
-
-
بانک:
+
+ بانک:
+
-
+
{data.bank}
diff --git a/helper/index.js b/helper/index.js
index 4008171..d9629dd 100644
--- a/helper/index.js
+++ b/helper/index.js
@@ -46,3 +46,35 @@ export const checkTimes = (arr) => {
return hasMorningTime && hasEveningTime;
});
};
+
+export const uploadImage = async (event) => {
+ let obj = {
+ file: "",
+ blob: "",
+ };
+
+ const file = event.target.files[0];
+ if (file) {
+ obj.file = file;
+ const readFileAsDataURL = (file) => {
+ return new Promise((resolve, reject) => {
+ const reader = new FileReader();
+
+ reader.onload = () => resolve(reader.result);
+
+ reader.onerror = (error) => reject(error);
+
+ reader.readAsDataURL(file);
+ });
+ };
+ try {
+ obj.blob = await readFileAsDataURL(file);
+ return obj;
+ } catch (error) {
+ console.error("Error reading file: ", error);
+ throw error;
+ }
+ } else {
+ throw new Error("No file selected");
+ }
+};