From 4c34211be54b637ddd5091eb020d7fefabc97934 Mon Sep 17 00:00:00 2001 From: Dima Rifai <dima.rifai@gmail.com> Date: Thu, 23 Jan 2025 20:10:26 +0200 Subject: [PATCH] Issue #433 - Use NoResult component --- .../searchesResults/BlockSearchResults.tsx | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/components/home/searches/searchesResults/BlockSearchResults.tsx b/components/home/searches/searchesResults/BlockSearchResults.tsx index b3b5348d..d107b850 100644 --- a/components/home/searches/searchesResults/BlockSearchResults.tsx +++ b/components/home/searches/searchesResults/BlockSearchResults.tsx @@ -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> + </> ); }; -- GitLab