Skip to content

Commit

Permalink
docs: search-box
Browse files Browse the repository at this point in the history
  • Loading branch information
faustoq committed Oct 10, 2024
1 parent bd2290d commit b57b1a4
Show file tree
Hide file tree
Showing 3 changed files with 12,133 additions and 15,587 deletions.
2 changes: 1 addition & 1 deletion packages/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@astrojs/starlight-tailwind": "^2.0.3",
"@astrojs/tailwind": "^5.1.0",
"@jop-software/astro-cookieconsent": "^3.0.0",
"@orama/react-components": "^0.0.25",
"@orama/react-components": "^0.0.28",
"@oramacloud/client": "^1.3.16",
"astro": "^4.11.3",
"astro-og-canvas": "^0.5.3",
Expand Down
9 changes: 4 additions & 5 deletions packages/docs/src/components/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ export function Search() {
const [theme, setTheme] = useState(document.documentElement.dataset.theme || 'dark')
const [currentCategory, setCurrentCategory] = useState(null)
const [userId, setUserId] = useState(getOramaUserId())

// TODO: Remove when fully integrated
const [isOpen, setIsOpen] = useState(false)

useEffect(() => {
Expand Down Expand Up @@ -125,13 +123,14 @@ export function Search() {
description: 'content'
}}
searchParams={{
// @ts-ignore
where: oramaWhere
where: oramaWhere as any
}}
facetProperty={facetProperty}
colorScheme={theme === 'light' ? 'light' : 'dark'}
open={isOpen}
suggestions={suggestions}
searchPlaceholder={`Search ${currentCategory === 'Open Source' ? 'Open Source' : 'Orama Cloud'}`}
chatPlaceholder='Ask me anything about Orama'
/>

<OramaSearchButton
Expand All @@ -142,7 +141,7 @@ export function Search() {
}}
style={{ width: '100%' }}
>
Search {currentCategory === 'Open Source' && 'Open Source'}
Search
</OramaSearchButton>
</>
)
Expand Down
Loading

0 comments on commit b57b1a4

Please sign in to comment.