```tsx
import {MessageRenderedCallback, MessageRenderedEventDetails, } from '@nlux/react';
import {useCallback} from 'react';

const messageRenderedCallback = useCallback<MessageRenderedCallback>((eventDetails: MessageRenderedEventDetails) => {
    // On message rendered, log the message to the console
    console.log(eventDetails.uid);
}, [/* Callback dependencies */]);
```

```tsx
// Provide the messageRendered callback as part of the events prop
<AiChat events={{messageRendered: messageRenderedCallback}} adapter={adapter} />
```
