hide pagination when there no result on question query
This commit is contained in:
@@ -59,23 +59,25 @@ export const QuestionsList: FC<Props> = ({ questions, title, pagination }) => {
|
|||||||
<div className="bg-gray-200 p-4 rounded my-2">
|
<div className="bg-gray-200 p-4 rounded my-2">
|
||||||
<div className="flex">
|
<div className="flex">
|
||||||
<h2 className="text-gray-500 font-medium text-xl">{title}</h2>
|
<h2 className="text-gray-500 font-medium text-xl">{title}</h2>
|
||||||
<div className="ml-auto text-sm sm:text-base text-gray-700">
|
{questions.length > 0 &&
|
||||||
<button
|
<div className="ml-auto text-sm sm:text-base text-gray-700">
|
||||||
className="p-2"
|
<button
|
||||||
onClick={handleOnPreviousPageClick}
|
className="p-2"
|
||||||
style={{ visibility: (pagination?.hasPreviousPage ? 'visible' : 'hidden') }}
|
onClick={handleOnPreviousPageClick}
|
||||||
>
|
style={{ visibility: (pagination?.hasPreviousPage ? 'visible' : 'hidden') }}
|
||||||
<FaArrowLeft />
|
>
|
||||||
</button>
|
<FaArrowLeft />
|
||||||
Página: {pageCount}
|
</button>
|
||||||
<button
|
Página: {pageCount}
|
||||||
className="p-2"
|
<button
|
||||||
onClick={handleOnNextPageClick}
|
className="p-2"
|
||||||
style={{ visibility: (pagination?.hasNextPage ? 'visible' : 'hidden') }}
|
onClick={handleOnNextPageClick}
|
||||||
>
|
style={{ visibility: (pagination?.hasNextPage ? 'visible' : 'hidden') }}
|
||||||
<FaArrowRight />
|
>
|
||||||
</button>
|
<FaArrowRight />
|
||||||
</div>
|
</button>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
<hr className="border-t border-gray-400 m-px" />
|
<hr className="border-t border-gray-400 m-px" />
|
||||||
<div className="p-2 text-sm">
|
<div className="p-2 text-sm">
|
||||||
|
|||||||
Reference in New Issue
Block a user