Skip to content

Commit

Permalink
hiding tabs if prompt isn't availabel
Browse files Browse the repository at this point in the history
  • Loading branch information
teresaqhoang committed Aug 11, 2023
1 parent cd86a4e commit 81b7477
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions webapp/src/components/chat/prompt-dialog/PromptDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,16 @@ export const PromptDialog: React.FC<IPromptDialogProps> = ({ message }) => {
<DialogTitle>Prompt</DialogTitle>
<DialogContent>
<TokenUsageGraph promptView tokenUsage={message.tokenUsage ?? {}} />
<TabList selectedValue={selectedTab} onTabSelect={onTabSelect}>
<Tab data-testid="formatted" id="formatted" value="formatted">
Formatted
</Tab>
<Tab data-testid="rawContent" id="rawContent" value="rawContent">
Raw Content
</Tab>
</TabList>
{message.prompt && (
<TabList selectedValue={selectedTab} onTabSelect={onTabSelect}>
<Tab data-testid="formatted" id="formatted" value="formatted">
Formatted
</Tab>
<Tab data-testid="rawContent" id="rawContent" value="rawContent">
Raw Content
</Tab>
</TabList>
)}
{selectedTab === 'formatted' && promptDetails}
{selectedTab === 'rawContent' &&
formatParagraphTextContent((prompt as BotResponsePrompt).rawContent)}
Expand Down

0 comments on commit 81b7477

Please sign in to comment.