Skip to content

Commit

Permalink
update system message component
Browse files Browse the repository at this point in the history
  • Loading branch information
aferd committed Apr 2, 2024
1 parent 30cd37c commit 21bfcdb
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,11 @@ Custom actions can be added to the assistant body using the `actions` property.
```js file="./VirtualAssistantWithActions.tsx"

```
### System Message Entry

The `SystemMessageEntry` component provides a simple system message with an option for text links.


```js file="./VirtualAssistantSystemMessageEntry.tsx"

```
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react';
import VirtualAssistant from '@patternfly/virtual-assistant/dist/dynamic/VirtualAssistant';
import SystemMessageEntry from '@patternfly/virtual-assistant/dist/esm/SystemMessageEntry'

export const BasicExample: React.FunctionComponent = () => (
<VirtualAssistant >
<SystemMessageEntry />
</VirtualAssistant>
);
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,27 @@ import React from 'react';
import { Text, TextContent, TextVariants } from '@patternfly/react-core';
import { createUseStyles } from 'react-jss';

export interface SystemMessageEntryProps {
text: string;
href: string;
}

const useStyles = createUseStyles({
systemMessageText: {
paddingBottom: "var(--pf-v5-global--spacer--md)",
textAlign: "center",
}
})

export const SystemMessageEntry = () => {
export const SystemMessageEntry: React.FunctionComponent<SystemMessageEntryProps> = (props) => {
const classes = useStyles();
return (
<TextContent>
<Text component={TextVariants.small} className={classes.systemMessageText}>
End of conversation
{props.text} {props.href}
</Text>
</TextContent>
);
};
};

export default SystemMessageEntry;
3 changes: 3 additions & 0 deletions packages/module/src/SystemMessageEntry/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export { default } from './SystemMessageEntry';

export * from './SystemMessageEntry';

0 comments on commit 21bfcdb

Please sign in to comment.