X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/84e4588aed7bea1bcf5727ef2eea1a692b4e3bab..5e61d3dd53b8ff5ea925d0897274cc267985e4f9:/src/views-components/search-bar/search-bar-autocomplete-view.tsx

diff --git a/src/views-components/search-bar/search-bar-autocomplete-view.tsx b/src/views-components/search-bar/search-bar-autocomplete-view.tsx
index c4b2457d..48172424 100644
--- a/src/views-components/search-bar/search-bar-autocomplete-view.tsx
+++ b/src/views-components/search-bar/search-bar-autocomplete-view.tsx
@@ -3,33 +3,38 @@
 // SPDX-License-Identifier: AGPL-3.0
 
 import * as React from 'react';
-import { Paper, StyleRulesCallback, withStyles, WithStyles, List, ListItem, ListItemText } from '@material-ui/core';
-import { ArvadosTheme } from '~/common/custom-theme';
-import { RecentQueriesItem } from '~/views-components/search-bar/search-bar-view';
+import { Paper, StyleRulesCallback, withStyles, WithStyles, List } from '@material-ui/core';
+import { RenderAutocompleteItems } from '~/views-components/search-bar/search-bar-view';
 import { GroupContentsResource } from '~/services/groups-service/groups-service';
 import Highlighter from "react-highlight-words";
 
-type CssRules = 'list';
+type CssRules = 'list' | 'searchView';
 
-const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
-    list: {
-        padding: 0
-    }
-});
+const styles: StyleRulesCallback<CssRules> = theme => {
+    return {
+        list: {
+            padding: 0
+        },
+        searchView: {
+            borderRadius: `0 0 ${theme.spacing.unit / 2}px ${theme.spacing.unit / 2}px`
+        }
+    };
+};
 
 export interface SearchBarAutocompleteViewDataProps {
     searchResults?: GroupContentsResource[];
     searchValue?: string;
+    navigateTo: (uuid: string) => void;
 }
 
 type SearchBarAutocompleteViewProps = SearchBarAutocompleteViewDataProps & WithStyles<CssRules>;
 
 export const SearchBarAutocompleteView = withStyles(styles)(
-    ({ classes, searchResults, searchValue }: SearchBarAutocompleteViewProps ) =>
-        <Paper>
-            {searchResults &&  <List component="nav" className={classes.list}>
+    ({ classes, searchResults, searchValue, navigateTo }: SearchBarAutocompleteViewProps) =>
+        <Paper className={classes.searchView}>
+            {searchResults && <List component="nav" className={classes.list}>
                 {searchResults.map((item: GroupContentsResource) => {
-                    return <RecentQueriesItem key={item.uuid} text={getFormattedText(item.name, searchValue)} />;
+                    return <RenderAutocompleteItems key={item.uuid} text={getFormattedText(item.name, searchValue)} navigateTo={navigateTo} uuid={item.uuid} />;
                 })}
             </List>}
         </Paper>
