Skip to content

Commit

Permalink
fix: remove import statements to unblock FDR deploy (#1502)
Browse files Browse the repository at this point in the history
  • Loading branch information
RohinBhargava authored Sep 19, 2024
1 parent 8c9a795 commit 1472eaf
Show file tree
Hide file tree
Showing 4 changed files with 424 additions and 40 deletions.
3 changes: 0 additions & 3 deletions packages/fdr-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,14 @@
"types": "dist/index.d.ts",
"exports": {
"./navigation": {
"import": "./src/navigation/index.ts",
"types": "./dist/navigation/index.d.ts",
"default": "./dist/navigation/index.js"
},
"./client/types": {
"import": "./src/client/types.ts",
"types": "./dist/client/types.d.ts",
"default": "./dist/client/types.js"
},
".": {
"import": "./src/index.ts",
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
Expand Down
81 changes: 45 additions & 36 deletions packages/ui/app/src/search/SearchHits.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { FernNavigation } from "@fern-api/fdr-sdk";
import { FernScrollArea } from "@fern-ui/components";
import { useKeyboardPress } from "@fern-ui/react-commons";
import { getSlugForSearchRecord, type SearchRecord } from "@fern-ui/search-utils";
import * as Accordion from "@radix-ui/react-accordion";
import { AccordionTrigger } from "@radix-ui/react-accordion";
import { useSetAtom } from "jotai";
import { useRouter } from "next/router";
import React, { PropsWithChildren, useEffect, useMemo, useRef, useState } from "react";
Expand Down Expand Up @@ -167,42 +169,49 @@ export const SearchHits: React.FC = () => {
onMouseEnter={() => setHoveredSearchHitId(COHERE_AI_HIT_ID)}
/>
)}
{endpointHits.length > 0 && (
<>
<h3 className="text-lg font-semibold my-4 pl-0.5">Endpoints</h3>
{endpointHits.map((hit) => (
<SearchHit
setRef={(elem) => {
if (elem != null) {
refs.current.set(hit.objectID, elem);
}
}}
key={hit.objectID}
hit={hit}
isHovered={hoveredSearchHitId === hit.objectID}
onMouseEnter={() => setHoveredSearchHitId(hit.objectID)}
/>
))}
</>
)}
{pageHits.length > 0 && (
<>
<h3 className="text-lg font-semibold my-4 pl-0.5">Pages</h3>
{pageHits.map((hit) => (
<SearchHit
setRef={(elem) => {
if (elem != null) {
refs.current.set(hit.objectID, elem);
}
}}
key={hit.objectID}
hit={hit}
isHovered={hoveredSearchHitId === hit.objectID}
onMouseEnter={() => setHoveredSearchHitId(hit.objectID)}
/>
))}
</>
)}
<Accordion.Root type="single" defaultValue="endpoints" collapsible>
{endpointHits.length > 0 && (
<Accordion.Item className="fern-search-accordion" value="endpoints">
<AccordionTrigger>Endpoints</AccordionTrigger>
<Accordion.Content>
{endpointHits.map((hit) => (
<SearchHit
setRef={(elem) => {
if (elem != null) {
refs.current.set(hit.objectID, elem);
}
}}
key={hit.objectID}
hit={hit}
isHovered={hoveredSearchHitId === hit.objectID}
onMouseEnter={() => setHoveredSearchHitId(hit.objectID)}
/>
))}
</Accordion.Content>
</Accordion.Item>
)}
{pageHits.length > 0 && (
<Accordion.Item className="fern-search-accordion" value="pages">
<AccordionTrigger>Pages</AccordionTrigger>
<Accordion.AccordionContent>
{pageHits.map((hit) => (
<SearchHit
setRef={(elem) => {
if (elem != null) {
refs.current.set(hit.objectID, elem);
}
}}
key={hit.objectID}
hit={hit}
isHovered={hoveredSearchHitId === hit.objectID}
onMouseEnter={() => setHoveredSearchHitId(hit.objectID)}
/>
))}
</Accordion.AccordionContent>
</Accordion.Item>
)}
</Accordion.Root>

{fieldHits.length > 0 && (
<>
<h3 className="text-lg font-semibold my-4 pl-0.5">Fields</h3>
Expand Down
Loading

0 comments on commit 1472eaf

Please sign in to comment.