Skip to content
Snippets Groups Projects
Commit 9dab6359 authored by Dima Rifai's avatar Dima Rifai
Browse files

Issue #433 - Use NoResult component

parent ccfb9ea4
No related tags found
No related merge requests found
Pipeline #113883 failed
......@@ -5,6 +5,7 @@ import useBlockSearch from "@/hooks/api/homePage/useBlockSearch";
import useOperationsTypes from "@/hooks/api/common/useOperationsTypes";
import ErrorPage from "@/pages/ErrorPage";
import { getBlockPageLink } from "../utils/blockSearchHelpers";
import NoResult from "@/components/NoResult";
const BlockSearchResults = () => {
const { blockSearchProps } = useSearchesContext();
......@@ -22,25 +23,25 @@ const BlockSearchResults = () => {
if (!blockSearchData) return;
return (
<div className="bg-theme dark:bg-theme p-2 md: h-fit rounded">
<div className="text-center">Results:</div>
<div className="flex flex-wrap">
{blockSearchData.total_blocks > 0 ? (
blockSearchData.blocks_result.map(({ block_num }) => (
<Link
key={block_num}
<>
{blockSearchData.total_blocks > 0 ? (
<div className="bg-theme dark:bg-theme p-2 md: h-fit rounded">
<div className="text-center">Results:</div>
<div className="flex flex-wrap pl-4">
{blockSearchData.blocks_result.map(({ block_num }) => (
<Link
key={block_num}
href={blockPageLink(block_num)}
>
<div className="m-1 border border-solid p-1">{block_num}</div>
</Link>
))
))}
</div>
</div>
) : (
<div className="flex justify-center w-full">
No blocks matching given criteria
</div>
<NoResult/>
)}
</div>
</div>
</>
);
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment