| 1 | import styles from '../../aiTool.module.scss'; |
| 2 | import WebView from '../../../../components/WebView'; |
| 3 | import { useLocation, useSearchParams } from 'react-router-dom'; |
| 4 | import { useEffect, useState } from 'react'; |
| 5 | |
| 6 | export default function Page() { |
| 7 | const location = useLocation(); |
| 8 | const searchParams = useSearchParams(); |
| 9 | const [webviewUrl, setWebviewUrl] = useState(''); |
| 10 | |
| 11 | useEffect(() => { |
| 12 | setWebviewUrl(searchParams[0].get('webviewUrl') || ''); |
| 13 | console.log(searchParams[0].get('webviewUrl')); |
| 14 | }, [location]); |
| 15 | |
| 16 | return ( |
| 17 | <div className={styles['aiTool-webview']}> |
| 18 | <WebView |
| 19 | url={webviewUrl} |
| 20 | key={webviewUrl} |
| 21 | allowpopups |
| 22 | partition={'aiTools'} |
| 23 | /> |
| 24 | </div> |
| 25 | ); |
| 26 | } |
| 27 |