feat: Add search by name and specialty card navigation

- Implemented search functionality to filter specialties by name
- Added navigation to /doctors page with specialty ID as query parameter when clicking on a specialty card
- Enhanced user experience by providing real-time search results and clear navigation path
This commit is contained in:
2025-05-02 14:14:10 +03:30
parent 8e87b7a346
commit ee47314658
4 changed files with 59 additions and 19 deletions
@@ -1,9 +1,17 @@
import TextLoading from "@/app/component/loading/Text";
import React from "react";
import { useRouter } from "next/navigation";
function ItemSpecialties({ data, loading }) {
const router = useRouter();
const handleClick = () => {
router.push(`/doctors?specialties=${data.id}`);
};
return (
<li
onClick={handleClick}
className="py-[17.5px] px-[12px] flex flex-col justify-center items-center gap-[16px]
rounded-lg bg-[#FFF] shadow-[0px_1px_24.8px_0px_rgba(204,_204,_204,_0.18)]
hover:bg-[#5559CE] transition-all duration-500 cursor-pointer hover-mode-item-speciality"