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C,EAAA,EAAU,CAA8BJ,KAAMA,GAA9B,QAAUA,EAAKG,QAAuB,MAGtKpC,IACA,SAAC,EAAAsC,YAAW,WACR,UAAC,EAAAC,IAAG,CAACC,QAASC,EAAAA,YAAAA,iBAA8BC,WAAY5C,EAAe6C,SAAS,QAAQC,QAzCrF,WAGnBrD,GAASkB,EAAAA,EAAAA,IAAuB,CAC5BC,OAAQ,CACJC,KAAML,EACNM,SAAU,KACVC,cAAe,KACfC,oBAAqB,KACrBC,cAAe,KACfC,KAAMd,EAAMkB,UAGxB,EA4BoI,WAC5G,SAACyB,EAAA,EAAiB,CAACC,KAAK,OAAO,gBAE/B,4BAAQ,mBAKhB3B,IAAW,iBAAK4B,MAAO,CAAEC,UAAW,SAAUC,QAAS,QAAS,WAC5D,wBAAI,mCACJ,wBAAI,kCAGZ,mBACA,uBAKhB,C","sources":["pages/search/PageSearch/PageSearch.jsx"],"sourcesContent":["import { Btn, LoaderPanel, BtnVariants, PanelCenter } from 'mga-commons'\r\nimport React, { useEffect } from 'react'\r\nimport { Helmet } from 'react-helmet'\r\nimport { FaAngleDoubleDown } from '@react-icons/all-files/fa/FaAngleDoubleDown'\r\nimport { FaSearch } from '@react-icons/all-files/fa/FaSearch'\r\nimport { useDispatch, useSelector } from 'react-redux'\r\nimport { useSearchParams } from 'react-router-dom'\r\nimport PanelRead from '../../../components/commons/PanelRead'\r\nimport CardSearch from '../../../components/anonymous/search/CardSearch'\r\nimport CardSearchMobile from '../../../components/anonymous/search/CardSearchMobile'\r\nimport { anonymousFicheGetItems, selectIsLoading, selectIsLoadingMore, selectSearchData } from '../../../slices/anonymous/anonymousFicheSlice'\r\nimport { useMobileQuery } from '../../../utils/MediaQueries'\r\nimport './PageSearch.css'\r\n\r\nconst PageSearch = () => {\r\n\r\n const isMobile = useMobileQuery()\r\n const dispatch = useDispatch()\r\n\r\n const searchData = useSelector(selectSearchData)\r\n const isLoading = useSelector(selectIsLoading)\r\n const isLoadingMore = useSelector(selectIsLoadingMore)\r\n\r\n const canLoadMore = searchData?.CanLoadMore\r\n const items = searchData?.Items\r\n\r\n let [searchParams, setSearchParams] = useSearchParams();\r\n let query = searchParams.get(\"q\");\r\n\r\n\r\n useEffect(() => {\r\n\r\n // Load data\r\n dispatch(anonymousFicheGetItems({\r\n params: {\r\n text: query,\r\n idWilaya: null,\r\n idTypeMedecin: null,\r\n idTypeEtablissement: null,\r\n idTypeService: null,\r\n from: 0\r\n }\r\n }))\r\n\r\n }, [query])\r\n\r\n const handleLoadMore = () => {\r\n\r\n // Load more\r\n dispatch(anonymousFicheGetItems({\r\n params: {\r\n text: query,\r\n idWilaya: null,\r\n idTypeMedecin: null,\r\n idTypeEtablissement: null,\r\n idTypeService: null,\r\n from: items.length\r\n }\r\n }))\r\n }\r\n\r\n\r\n if (isLoading) {\r\n return \r\n }\r\n\r\n const isEmpty = !isLoadingMore && ((items || []).length === 0)\r\n\r\n return (\r\n
\r\n \r\n Résultats de la recherche pour {query}\r\n \r\n \r\n \r\n \r\n \r\n

\r\n \r\n Résultats de la recherche pour \"{query}\"\r\n

\r\n
\r\n {(items || []).map((item, index) => isMobile ? : )}\r\n
\r\n {\r\n canLoadMore &&\r\n \r\n \r\n \r\n    \r\n Voir plus\r\n \r\n \r\n }\r\n {\r\n isEmpty &&
\r\n

Aucun résultat trouvé !

\r\n

Veuillez réessayer ...

\r\n
\r\n }\r\n
\r\n
\r\n
\r\n
\r\n\r\n )\r\n}\r\n\r\nexport default PageSearch"],"names":["isMobile","useMobileQuery","dispatch","useDispatch","searchData","useSelector","selectSearchData","isLoading","selectIsLoading","isLoadingMore","selectIsLoadingMore","canLoadMore","CanLoadMore","items","Items","useSearchParams","searchParams","query","get","useEffect","anonymousFicheGetItems","params","text","idWilaya","idTypeMedecin","idTypeEtablissement","idTypeService","from","LoaderPanel","margin","isEmpty","length","className","Helmet","name","content","rel","href","window","location","origin","PanelRead","FaSearch","map","item","index","CardSearchMobile","IdFiche","CardSearch","PanelCenter","Btn","variant","BtnVariants","isEnabled","minWidth","onClick","FaAngleDoubleDown","size","style","textAlign","padding"],"sourceRoot":""}