diff --git a/frontend/src/routes/_layout/search.module.css b/frontend/src/routes/_layout/search.module.css new file mode 100644 index 0000000..1d0b4a8 --- /dev/null +++ b/frontend/src/routes/_layout/search.module.css @@ -0,0 +1,7 @@ +.dataKey { + width: 30%; + font-weight: bold; +} +.dataValue { + width: 70%; +} \ No newline at end of file diff --git a/frontend/src/routes/_layout/search.tsx b/frontend/src/routes/_layout/search.tsx index d623e5d..068fac7 100644 --- a/frontend/src/routes/_layout/search.tsx +++ b/frontend/src/routes/_layout/search.tsx @@ -1,6 +1,9 @@ import { Search2Icon } from "@chakra-ui/icons" import { + Box, Button, + Card, + CardBody, Container, Flex, FormControl, @@ -11,16 +14,11 @@ import { InputLeftElement, InputRightAddon, Link, + LinkBox, + LinkOverlay, Spinner, Stack, - Table, - TableContainer, - Tbody, - Td, Text, - Th, - Thead, - Tr, } from "@chakra-ui/react" import { Link as RouterLink, createFileRoute } from "@tanstack/react-router" import React from "react" @@ -34,6 +32,8 @@ export const Route = createFileRoute("/_layout/search")({ component: Search, }) +import classes from "./search.module.css" + interface SearchForm { query: string } @@ -122,6 +122,10 @@ function Search() { return ted_id.substring(0, ted_id.lastIndexOf("_")) } + function formatTaxName(tax_scientific_name: string) { + return tax_scientific_name.split("_").map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ") + } + const first_entry = domain_summary_entries?.data[0] const uniprot_items = domain_summary_entries ? first_entry @@ -180,44 +184,29 @@ function Search() { /> {getSearchMessage()} {uniprot_items?.length && ( - <> - - - - - AlphaFold ID - UniProt - Taxonomy - TED Domains - Link - - - - {uniprot_items.map((item) => ( - - {tedToAf(item.ted_id)} - {item.uniprot_acc} - - - {item.tax_scientific_name} - {/* {item.tax_lineage.split(',').join(" > ")} */} - - - {ted_count} - - - Go - - - - ))} - - - - > + + {uniprot_items.map((item) => ( + + + + + {tedToAf(item.ted_id)} + + + + TED Consensus Domains + {ted_count} + + + Source Organism + {formatTaxName(item.tax_scientific_name)} + + + + + + ))} + )}