Skip to content

Commit

Permalink
chore: add an initial disclaimer to Unleash AI (#8482)
Browse files Browse the repository at this point in the history
  • Loading branch information
nunogois authored Oct 18, 2024
1 parent ffcfe85 commit 5b1e875
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
6 changes: 4 additions & 2 deletions frontend/src/component/ai/AIChat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { AIChatInput } from './AIChatInput';
import { AIChatMessage } from './AIChatMessage';
import { AIChatHeader } from './AIChatHeader';
import { Resizable } from 'component/common/Resizable/Resizable';
import { AIChatDisclaimer } from './AIChatDisclaimer';

const AI_ERROR_MESSAGE = {
role: 'assistant',
Expand Down Expand Up @@ -176,9 +177,9 @@ export const AIChat = () => {
<StyledAIChatContainer>
<StyledResizable
handlers={['top-left', 'top', 'left']}
minSize={{ width: '270px', height: '200px' }}
minSize={{ width: '270px', height: '250px' }}
maxSize={{ width: '90vw', height: '90vh' }}
defaultSize={{ width: '320px', height: '450px' }}
defaultSize={{ width: '320px', height: '500px' }}
onResize={() => scrollToEnd({ onlyIfAtEnd: true })}
>
<StyledChat>
Expand All @@ -187,6 +188,7 @@ export const AIChat = () => {
onClose={() => setOpen(false)}
/>
<StyledChatContent>
<AIChatDisclaimer />
<AIChatMessage from='assistant'>
Hello, how can I assist you?
</AIChatMessage>
Expand Down
19 changes: 19 additions & 0 deletions frontend/src/component/ai/AIChatDisclaimer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { styled } from '@mui/material';

const StyledDisclaimer = styled('aside')(({ theme }) => ({
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
textAlign: 'center',
width: '100%',
color: theme.palette.secondary.dark,
fontSize: theme.fontSizes.smallerBody,
marginBottom: theme.spacing(2),
}));

export const AIChatDisclaimer = () => (
<StyledDisclaimer>
By using this assistant you accept that all data you share in this chat
can be shared with OpenAI
</StyledDisclaimer>
);

0 comments on commit 5b1e875

Please sign in to comment.