change list sort doctors page & change function search list specialties & remove pagination from page specialties & fix zoom page & change design all fields & change regex validation phone number for nobat724 and clinic-pro
This commit is contained in:
@@ -1,16 +1,7 @@
|
||||
import MenuS from "@/components/icons/MenuS";
|
||||
import Pagination from "@/app/component/Pagination";
|
||||
import ItemSpecialties from "./ItemSpecialties";
|
||||
import { useState } from "react";
|
||||
|
||||
function List({ specialties = [] }) {
|
||||
const [page, setPage] = useState(1);
|
||||
const itemsPerPage = 24;
|
||||
|
||||
const startIndex = (page - 1) * itemsPerPage;
|
||||
const endIndex = startIndex + itemsPerPage;
|
||||
const currentList = specialties.filter((_, i) => i >= startIndex && i < endIndex);
|
||||
|
||||
return (
|
||||
<div className="bg-[#FAFAFA]">
|
||||
<div className="flex items-center justify-center gap-[12px] pt-[24px] mb-[40px]">
|
||||
@@ -29,19 +20,11 @@ function List({ specialties = [] }) {
|
||||
gap-x-[16px] md:gap-x-[20px] lg:gap-x-[24px]
|
||||
gap-y-[16px] sm:gap-y-[24px] md:gap-y-[32px] lg:gap-y-[40px]"
|
||||
>
|
||||
{currentList.map((speciality) => (
|
||||
{specialties.map((speciality) => (
|
||||
<ItemSpecialties data={speciality} key={speciality.id} />
|
||||
))}
|
||||
</ul>
|
||||
)}
|
||||
<div className="mt-[48px] flex justify-center">
|
||||
<Pagination
|
||||
page={page}
|
||||
setPage={setPage}
|
||||
list={specialties}
|
||||
itemsPerPage={itemsPerPage}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user