File tree Expand file tree Collapse file tree 6 files changed +32
-32
lines changed
apps/site/components/Common/Searchbox
packages/ui-components/src/Common/Search Expand file tree Collapse file tree 6 files changed +32
-32
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,8 @@ import SearchModal from '@node-core/ui-components/Common/Search/Modal';
55import SearchResults from '@node-core/ui-components/Common/Search/Results' ;
66import SearchSuggestions from '@node-core/ui-components/Common/Search/Suggestions' ;
77import { useTranslations } from 'next-intl' ;
8- import { useState , type FC } from 'react' ;
8+ import { useState } from 'react' ;
9+ import type { FC } from 'react' ;
910
1011import { DEFAULT_ORAMA_QUERY_PARAMS } from '#site/next.constants.mjs' ;
1112
Original file line number Diff line number Diff line change @@ -5,8 +5,9 @@ import { useChat } from '@orama/ui/hooks';
55import type { FC , PropsWithChildren } from 'react' ;
66import { useEffect , useRef } from 'react' ;
77
8+ import SearchSuggestions from '#ui/Common/Search/Suggestions' ;
9+
810import styles from './index.module.css' ;
9- import SearchSuggestions from '../../Suggestions' ;
1011
1112type ChatInputProps = {
1213 suggestions : Array < string > ;
Original file line number Diff line number Diff line change 1- 'use client' ;
2-
31import { MagnifyingGlassIcon } from '@heroicons/react/24/solid' ;
42import type { OramaCloud } from '@orama/core' ;
53import { SearchRoot , ChatRoot , Modal } from '@orama/ui/components' ;
64import type { ComponentProps , FC , PropsWithChildren } from 'react' ;
75
6+ import SearchInput from '#ui/Common/Search/Input' ;
7+
88import styles from './index.module.css' ;
9- import SearchInput from '../Input' ;
109
1110type SearchModalProps = {
1211 client : OramaCloud | null ;
Original file line number Diff line number Diff line change 11import { SearchResults } from '@orama/ui/components' ;
22import classNames from 'classnames' ;
3- import { type FC } from 'react' ;
3+ import type { FC } from 'react' ;
44
55import styles from './index.module.css' ;
66
Original file line number Diff line number Diff line change @@ -12,28 +12,26 @@ type TabsProps = Omit<
1212 searchTerm ?: string | null ;
1313} ;
1414
15- const Tabs : FC < TabsProps > = ( { selectedFacet, ...props } ) => {
16- return (
17- < FacetTabs . Wrapper className = { styles . facetTabsWrapper } >
18- < FacetTabs . List className = { styles . facetTabsList } >
19- { ( group , isSelected ) => (
20- < FacetTabs . Item
21- { ...props }
22- isSelected = { group . name === selectedFacet }
23- group = { group }
24- filterBy = "siteSection"
25- className = { classNames (
26- isSelected && styles . facetTabItemSelected ,
27- styles . facetTabItem
28- ) }
29- >
30- { group . name }
31- < span className = { styles . facetTabItemCount } > ({ group . count } )</ span >
32- </ FacetTabs . Item >
33- ) }
34- </ FacetTabs . List >
35- </ FacetTabs . Wrapper >
36- ) ;
37- } ;
15+ const Tabs : FC < TabsProps > = ( { selectedFacet, ...props } ) => (
16+ < FacetTabs . Wrapper className = { styles . facetTabsWrapper } >
17+ < FacetTabs . List className = { styles . facetTabsList } >
18+ { ( group , isSelected ) => (
19+ < FacetTabs . Item
20+ { ...props }
21+ isSelected = { group . name === selectedFacet }
22+ group = { group }
23+ filterBy = "siteSection"
24+ className = { classNames (
25+ isSelected && styles . facetTabItemSelected ,
26+ styles . facetTabItem
27+ ) }
28+ >
29+ { group . name }
30+ < span className = { styles . facetTabItemCount } > ({ group . count } )</ span >
31+ </ FacetTabs . Item >
32+ ) }
33+ </ FacetTabs . List >
34+ </ FacetTabs . Wrapper >
35+ ) ;
3836
3937export default Tabs ;
Original file line number Diff line number Diff line change @@ -2,10 +2,11 @@ import { SearchResults } from '@orama/ui/components';
22import { useSearch } from '@orama/ui/hooks/useSearch' ;
33import type { ComponentProps , FC } from 'react' ;
44
5- import SearchResultsEmpty from './Empty' ;
5+ import SearchResultsEmpty from '#ui/Common/Search/Results/Empty' ;
6+ import SearchResultsSkeleton from '#ui/Common/Search/Results/Skeleton' ;
7+ import Tabs from '#ui/Common/Search/Results/Tabs' ;
8+
69import styles from './index.module.css' ;
7- import SearchResultsSkeleton from './Skeleton' ;
8- import Tabs from './Tabs' ;
910
1011type SearchResultsWrapperProps = {
1112 searchParams : Omit < ComponentProps < typeof Tabs > [ 'searchParams' ] , 'term' > ;
You can’t perform that action at this time.
0 commit comments