From c4b5c31111a8862d6552b402b218f0f320ee067b Mon Sep 17 00:00:00 2001 From: Khoroshevskyi Date: Fri, 7 Jun 2024 09:50:46 -0400 Subject: [PATCH] updated search window --- .../search/search-results-table.tsx | 193 ++++++++++-------- 1 file changed, 105 insertions(+), 88 deletions(-) diff --git a/ui/src/components/search/search-results-table.tsx b/ui/src/components/search/search-results-table.tsx index 0a108be..61f6010 100644 --- a/ui/src/components/search/search-results-table.tsx +++ b/ui/src/components/search/search-results-table.tsx @@ -1,97 +1,114 @@ -import { ProgressBar } from 'react-bootstrap'; -import { components } from '../../../bedbase-types'; -import { roundToTwoDecimals } from '../../utils'; -import { useBedCart } from '../../contexts/bedcart-context'; +import {ProgressBar} from 'react-bootstrap'; +import {components} from '../../../bedbase-types'; +import {roundToTwoDecimals} from '../../utils'; +import {useBedCart} from '../../contexts/bedcart-context'; +import {OverlayTrigger, Tooltip} from 'react-bootstrap'; import toast from 'react-hot-toast'; type SearchResponse = components['schemas']['BedListSearchResult']; type Props = { - results: SearchResponse; + results: SearchResponse; }; export const SearchResultsTable = (props: Props) => { - const { results } = props; - const { cart, addBedToCart, removeBedFromCart } = useBedCart(); - return ( - - - - - - - - - {/* */} - - - - - - {results.results?.map((result) => ( - - - - - - - {/* */} - - - - - ))} - -
NameGenomeCell TypeDescriptionScoreBEDbase IDSubmitted - Actions -
{result?.metadata?.name || 'No name'} - {result?.payload.genome || 'N/A'} - {result?.payload.cell_type || 'No cell type'}{result?.payload.description || 'No description'} - - {result?.metadata?.id || 'No id'} - {result?.metadata?.submission_date === undefined - ? 'No date' - : new Date(result.metadata?.submission_date).toLocaleDateString()} - - - - - {cart.includes(result?.metadata?.id || '') ? ( - - ) : ( - - )} -
- ); + const {results} = props; + const {cart, addBedToCart, removeBedFromCart} = useBedCart(); + return ( + + + + + + + + + + + {/* */} + + + + + {results.results?.map((result) => ( + + + + + + + {/**/} + {/**/} + + + {/* */} + {/**/} + + + ))} + +
NameGenomeTissueCell TypeAntibodyDescriptionScoreBEDbase ID + Actions +
{result?.metadata?.name || 'No name'} + {result?.payload.genome || 'N/A'} + {result?.payload.tissue || 'N/A'}{result?.payload.cell_type || 'N/A'}{result?.payload.antibody || 'N/A'}{result?.payload.description || 'No description'} + + {result?.payload.description || 'No description'} + + } + > + + + + + {result?.metadata?.id || 'No id'}*/} + {/* /!*{result?.metadata?.submission_date === undefined*!/*/} + {/* /!* ? 'No date'*!/*/} + {/* /!* : new Date(result.metadata?.submission_date).toLocaleDateString()}*!/\*/} + {/* */} + {/* + + + + {cart.includes(result?.metadata?.id || '') ? ( + + ) : ( + + )} +
+ ); };