change date type for req & design and fields & add requests & fix bug appointment and dashboard

This commit is contained in:
Ehsan
2025-07-04 23:44:29 +03:30
parent 597fa1931d
commit f951128074
19 changed files with 273 additions and 58 deletions
@@ -3,7 +3,18 @@ import Field from "@/app/component/Field";
function Content({ setData, data }) {
const handleChange = (name, value) =>
setData((prev) => ({ ...prev, [name]: value }));
name === "phone" || name === "address"
? setData((prev) => ({
...prev,
contact: {
...prev.contact,
[name]: value,
},
}))
: setData((prev) => ({
...prev,
[name]: value,
}));
return (
<div className="mt-[32px] md:mt-[36px] lg:mt-[40px] flex flex-col gap-[24px] md:gap-[28px] lg:gap-[32px] px-0 sm:px-[52px]">
@@ -33,7 +44,7 @@ function Content({ setData, data }) {
type="number"
name="phone"
isPlaceHolder={true}
value={Number(data?.phone.replace(/^\+/, ""))}
value={Number(data?.contact?.phone.replace(/^\+/, ""))}
handleChange={handleChange}
/>
</FieldLabel>
@@ -43,7 +54,7 @@ function Content({ setData, data }) {
type="text"
name="address"
isPlaceHolder={true}
value={data?.address}
value={data?.contact?.address}
handleChange={handleChange}
/>
</FieldLabel>