@@ -4,6 +4,7 @@ import Image from 'next/image';
4
4
import Script from 'next/script' ;
5
5
import Link from 'next/link' ;
6
6
import axios from 'axios' ;
7
+ import { ToastContainer , toast } from 'react-toastify' ;
7
8
import {
8
9
Menu , Transition , Disclosure , Switch ,
9
10
} from '@headlessui/react' ;
@@ -17,6 +18,7 @@ import Output from '../components/Output';
17
18
import vscode from '../assets/vsc.svg' ;
18
19
import logo from '../assets/mintlify.svg' ;
19
20
import EXAMPLES from '../content/examples' ;
21
+ import 'react-toastify/dist/ReactToastify.css' ;
20
22
21
23
const ENDPOINT = process . env . NODE_ENV === 'development'
22
24
? 'http://localhost:5000'
@@ -161,8 +163,8 @@ export default function Example() {
161
163
162
164
setOutputDisplay ( docstring ) ;
163
165
} catch ( error : any ) {
164
- const errorMessage = error . response ?. data . error || 'An enexpected error occurred' ;
165
- console . log ( { errorMessage } ) ;
166
+ const errorMessage = error ? .response ?. data ? .error || 'An enexpected error occurred' ;
167
+ toast ( errorMessage ) ;
166
168
} finally {
167
169
setIsGenerating ( false ) ;
168
170
}
@@ -574,6 +576,7 @@ export default function Example() {
574
576
</ p >
575
577
</ div >
576
578
</ footer >
579
+ < ToastContainer position = "bottom-right" />
577
580
< Script >
578
581
{ `// Initialize the agent at application startup.
579
582
fpPromise = new Promise((resolve, reject) => {
0 commit comments