Skip to content

Commit

Permalink
hide download logs button for mutli_agents report
Browse files Browse the repository at this point in the history
  • Loading branch information
ElishaKay committed Dec 21, 2024
1 parent 5d1dc7e commit e1535bf
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
1 change: 1 addition & 0 deletions frontend/nextjs/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ export default function Home() {
orderedData={orderedData}
answer={answer}
allLogs={allLogs}
chatBoxSettings={chatBoxSettings}
handleClickSuggestion={handleClickSuggestion}
/>
</div>
Expand Down
10 changes: 6 additions & 4 deletions frontend/nextjs/components/ResearchBlocks/AccessReport.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ interface AccessReportProps {
pdf?: string;
docx?: string;
json?: string;
};
};
chatBoxSettings: any;
logs?: any[];
report: string;
}

const AccessReport: React.FC<AccessReportProps> = ({ accessData, report }) => {
const AccessReport: React.FC<AccessReportProps> = ({ accessData, chatBoxSettings, report }) => {
const host = getHost();

const getReportLink = (dataType: 'pdf' | 'docx' | 'json'): string => {
Expand Down Expand Up @@ -39,13 +41,13 @@ const AccessReport: React.FC<AccessReportProps> = ({ accessData, report }) => {
rel="noopener noreferrer">
Download DocX
</a>
<a
{chatBoxSettings.report_type === 'research_report' && <a
href={getReportLink('json')}
className="bg-purple-500 text-white active:bg-purple-600 font-bold uppercase text-sm px-6 py-3 rounded shadow hover:shadow-lg outline-none focus:outline-none mr-1 mb-1 ease-linear transition-all duration-150"
target="_blank"
rel="noopener noreferrer">
Download Logs
</a>
</a>}
</div>
);
};
Expand Down
4 changes: 3 additions & 1 deletion frontend/nextjs/components/ResearchResults.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ interface ResearchResultsProps {
orderedData: Data[];
answer: string;
allLogs: any[];
chatBoxSettings: any;
handleClickSuggestion: (value: string) => void;
}

export const ResearchResults: React.FC<ResearchResultsProps> = ({
orderedData,
answer,
allLogs,
chatBoxSettings,
handleClickSuggestion
}) => {
const groupedData = preprocessOrderedData(orderedData);
Expand Down Expand Up @@ -72,7 +74,7 @@ export const ResearchResults: React.FC<ResearchResultsProps> = ({
{sourceComponents}
{imageComponents}
{finalReport && <Answer answer={finalReport.content} />}
{pathData && <AccessReport accessData={pathData.output} report={answer} />}
{pathData && <AccessReport accessData={pathData.output} report={answer} chatBoxSettings={chatBoxSettings} />}
{chatComponents}
</>
);
Expand Down

0 comments on commit e1535bf

Please sign in to comment.