Skip to content

Commit

Permalink
LLMAttachments: made the AGI prompts optional
Browse files Browse the repository at this point in the history
  • Loading branch information
enricoros committed Jan 10, 2025
1 parent b1d94e7 commit c8cbeff
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export type LLMAttachmentDraftsAction = 'inline-text' | 'copy-text';
* Renderer of attachment drafts, with menus, etc.
*/
export function LLMAttachmentsList(props: {
agiAttachmentPrompts: AgiAttachmentPromptsData
agiAttachmentPrompts?: AgiAttachmentPromptsData,
attachmentDraftsStoreApi: AttachmentDraftsStoreApi,
canInlineSomeFragments: boolean,
llmAttachmentDrafts: LLMAttachmentDraft[],
Expand Down Expand Up @@ -142,7 +142,7 @@ export function LLMAttachmentsList(props: {
<Box sx={{ height: '100%', pr: 5, overflowX: 'auto', display: 'flex', alignItems: 'center', gap: 1 }}>

{/* AI Suggestion Button */}
{(agiAttachmentPrompts.isVisible || agiAttachmentPrompts.hasData) && (
{(!!agiAttachmentPrompts && (agiAttachmentPrompts.isVisible || agiAttachmentPrompts.hasData)) && (
<LLMAttachmentsPromptsButtonMemo data={agiAttachmentPrompts} />
)}

Expand Down Expand Up @@ -212,10 +212,12 @@ export function LLMAttachmentsList(props: {
placement='top-start'
>
{/* uses the agiAttachmentPrompts to imagine what the user will ask aboud those */}
<MenuItem color='primary' variant='soft' onClick={agiAttachmentPrompts.refetch} disabled={!hasAttachments || agiAttachmentPrompts.isFetching}>
<ListItemDecorator>{agiAttachmentPrompts.isFetching ? <CircularProgress size='sm' /> : <AutoFixHighIcon />}</ListItemDecorator>
What can I do?
</MenuItem>
{!!agiAttachmentPrompts && (
<MenuItem color='primary' variant='soft' onClick={agiAttachmentPrompts.refetch} disabled={!hasAttachments || agiAttachmentPrompts.isFetching}>
<ListItemDecorator>{agiAttachmentPrompts.isFetching ? <CircularProgress size='sm' /> : <AutoFixHighIcon />}</ListItemDecorator>
What can I do?
</MenuItem>
)}

<ListDivider />

Expand Down

0 comments on commit c8cbeff

Please sign in to comment.