add auto-selecotr to home page and handle set in data, search in specialties and send req for filter && add locations and change text

This commit is contained in:
Ehsan
2025-09-15 19:45:39 +03:30
parent 153cb5bc9f
commit 41ba7aa709
14 changed files with 88 additions and 62 deletions
+2 -2
View File
@@ -31,9 +31,9 @@ function Title({ doctor }) {
<TextLoading width={100} height={20}>
<h3 className="text-[#525252] text-[14px] md:text-[16px] font-medium">
تخصص:
{doctor?.expertise?.map(
{doctor?.specialties?.map(
(item, idx) =>
`${item.name} ${doctor.expertise.length === idx + 1 ? "" : "|"} `
`${item.name} ${doctor.specialties.length === idx + 1 ? "" : "|"} `
)}
</h3>
</TextLoading>
@@ -44,7 +44,7 @@ function AboutDcotor({ doctor }) {
تخصص ها
</p>
<ul className="flex flex-col mt-[12px] sm:flex-row gap-y-[16px] items-start sm:items-center justify-start gap-4">
{doctor?.specialties?.map((item, idx) => (
{doctor?.expertise?.map((item, idx) => (
<li key={idx} className="flex items-center justify-start gap-1">
<span className="w-2 h-2 bg-[#F17732] rounded-full"></span>
<TextLoading width={70} height={18}>
@@ -7,7 +7,7 @@ import ModalOpenLocation from "@/app/component/openLocation";
import RoutingWhiteC from "@/components/icons/RoutingWhiteC";
import RoutingC from "@/components/icons/RoutingC";
function Item({ data }) {
function Item({ doctor, data }) {
const [isOpen, setIsOpen] = useState(false);
const [open, setOpen] = useState(false);
@@ -25,7 +25,7 @@ function Item({ data }) {
onClick={() => setIsOpen(!isOpen)}
className="!px-[2px] !py-[4px] !flex !items-center !justify-between !w-full"
>
<p className="text-[#616161] text-[16px] font-medium">{data.title}</p>
<p className="text-[#616161] text-[16px] font-medium">{data.name}</p>
<div
className={`
transition-all duration-500
@@ -46,11 +46,11 @@ function Item({ data }) {
آدرس: {data.address}
</p>
<p className="text-[#525252] text-[16px] font-normal">
تلفن: {data.phone}
تلفن: {data.telephone}
</p>
<div className="flex w-full items-center justify-between">
<p className="text-[#525252] text-[16px] font-normal">
روزهای کاری: {data.working_days}
روزهای کاری: {doctor.hours_of_work}
</p>
<ModalOpenLocation
open={open}
@@ -70,14 +70,13 @@ function Item({ data }) {
</div>
<div className="w-full relative h-[219px] sm:h-[302px] md:h-[385px] lg:h-[470px] mt-[24px]">
<iframe
src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d99748.77423686371!2d2.264635095144491!3d48.85882549249809!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x47e66e1f06e2b70f%3A0x40b82c3688c9460!2sParis%2C%20France!5e1!3m2!1sen!2snl!4v1724802057795!5m2!1sen!2snl"
className="
w-full rounded-lg mt-4 h-full
"
src={`https://maps.google.com/maps?q=${data.map.latitude},${data.map.longitude}&z=14&output=embed`}
className="w-full rounded-lg mt-4 h-full"
referrerPolicy="no-referrer-when-downgrade"
allowFullScreen=""
loading="lazy"
></iframe>
<ModalOpenLocation
open={open}
setOpen={setOpen}
@@ -8,11 +8,11 @@ function Locations({ doctor }) {
موقعیت مکانی{" "}
</p>
<ul className="flex w-full mt-[24px] flex-col justify-center items-start">
{doctor?.locations?.map((item, idx) => (
{doctor?.address?.map((item, idx) => (
<CustomLoading key={idx} width="full" height={40}>
<li className="w-full">
<Item data={item} />
{doctor?.locations.length > idx + 1 && (
<Item doctor={doctor} data={item} />
{doctor?.address.length > idx + 1 && (
<span className="w-full h-px bg-[#EFEFEF] block my-[12px] md:my-[14px] lg:my-[16px]"></span>
)}
</li>
+2 -2
View File
@@ -12,9 +12,9 @@ function DoctorPage({ doctor, doctors, comments }) {
<CustomLoading width={180} height={25}>
<div className="flex items-center justify-start text-[14px] md:text-[16px] font-normal">
<h2 className="text-[#9B9B9B] text-nowrap">
{doctor?.expertise?.map(
{doctor?.specialties?.map(
(item, idx) =>
`${item.name} ${doctor.expertise.length === idx + 1 ? ">" : "|"} `
`${item.name} ${doctor.specialties.length === idx + 1 ? ">" : "|"} `
)}
</h2>
<p className="text-[#525252] text-nowrap mr-1">{doctor?.name}</p>