mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-07 13:23:15 +00:00
Show generated code artifacts before notes and online references
This commit is contained in:
@@ -488,10 +488,10 @@ export function TeaserReferencesSection(props: TeaserReferenceSectionProps) {
|
|||||||
setNumTeaserSlots(props.isMobileWidth ? 1 : 3);
|
setNumTeaserSlots(props.isMobileWidth ? 1 : 3);
|
||||||
}, [props.isMobileWidth]);
|
}, [props.isMobileWidth]);
|
||||||
|
|
||||||
const notesDataToShow = props.notesReferenceCardData.slice(0, numTeaserSlots);
|
const codeDataToShow = props.codeReferenceCardData.slice(0, numTeaserSlots);
|
||||||
const codeDataToShow = props.codeReferenceCardData.slice(
|
const notesDataToShow = props.notesReferenceCardData.slice(
|
||||||
0,
|
0,
|
||||||
numTeaserSlots - notesDataToShow.length,
|
numTeaserSlots - codeDataToShow.length,
|
||||||
);
|
);
|
||||||
const onlineDataToShow =
|
const onlineDataToShow =
|
||||||
notesDataToShow.length + codeDataToShow.length < numTeaserSlots
|
notesDataToShow.length + codeDataToShow.length < numTeaserSlots
|
||||||
@@ -522,15 +522,6 @@ export function TeaserReferencesSection(props: TeaserReferenceSectionProps) {
|
|||||||
<p className="text-gray-400 m-2">{numReferences} sources</p>
|
<p className="text-gray-400 m-2">{numReferences} sources</p>
|
||||||
</h3>
|
</h3>
|
||||||
<div className={`flex flex-wrap gap-2 w-auto mt-2`}>
|
<div className={`flex flex-wrap gap-2 w-auto mt-2`}>
|
||||||
{notesDataToShow.map((note, index) => {
|
|
||||||
return (
|
|
||||||
<NotesContextReferenceCard
|
|
||||||
showFullContent={false}
|
|
||||||
{...note}
|
|
||||||
key={`${note.title}-${index}`}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
{codeDataToShow.map((code, index) => {
|
{codeDataToShow.map((code, index) => {
|
||||||
return (
|
return (
|
||||||
<CodeContextReferenceCard
|
<CodeContextReferenceCard
|
||||||
@@ -540,6 +531,15 @@ export function TeaserReferencesSection(props: TeaserReferenceSectionProps) {
|
|||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
|
{notesDataToShow.map((note, index) => {
|
||||||
|
return (
|
||||||
|
<NotesContextReferenceCard
|
||||||
|
showFullContent={false}
|
||||||
|
{...note}
|
||||||
|
key={`${note.title}-${index}`}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
})}
|
||||||
{onlineDataToShow.map((online, index) => {
|
{onlineDataToShow.map((online, index) => {
|
||||||
return (
|
return (
|
||||||
<GenericOnlineReferenceCard
|
<GenericOnlineReferenceCard
|
||||||
@@ -584,15 +584,6 @@ export default function ReferencePanel(props: ReferencePanelDataProps) {
|
|||||||
<SheetDescription>View all references for this response</SheetDescription>
|
<SheetDescription>View all references for this response</SheetDescription>
|
||||||
</SheetHeader>
|
</SheetHeader>
|
||||||
<div className="flex flex-wrap gap-2 w-auto mt-2">
|
<div className="flex flex-wrap gap-2 w-auto mt-2">
|
||||||
{props.notesReferenceCardData.map((note, index) => {
|
|
||||||
return (
|
|
||||||
<NotesContextReferenceCard
|
|
||||||
showFullContent={true}
|
|
||||||
{...note}
|
|
||||||
key={`${note.title}-${index}`}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
{props.codeReferenceCardData.map((code, index) => {
|
{props.codeReferenceCardData.map((code, index) => {
|
||||||
return (
|
return (
|
||||||
<CodeContextReferenceCard
|
<CodeContextReferenceCard
|
||||||
@@ -602,6 +593,15 @@ export default function ReferencePanel(props: ReferencePanelDataProps) {
|
|||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
|
{props.notesReferenceCardData.map((note, index) => {
|
||||||
|
return (
|
||||||
|
<NotesContextReferenceCard
|
||||||
|
showFullContent={true}
|
||||||
|
{...note}
|
||||||
|
key={`${note.title}-${index}`}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
})}
|
||||||
{props.onlineReferenceCardData.map((online, index) => {
|
{props.onlineReferenceCardData.map((online, index) => {
|
||||||
return (
|
return (
|
||||||
<GenericOnlineReferenceCard
|
<GenericOnlineReferenceCard
|
||||||
|
|||||||
Reference in New Issue
Block a user