import React from 'react'; import { useTokenKeys } from '../../components/fetchTokenKeys'; import { Layout } from '@douyinfe/semi-ui'; const ChatPage = () => { const { keys, chatLink, serverAddress, isLoading } = useTokenKeys(); const comLink = (key) => { if (!chatLink || !serverAddress || !key) return ''; return `${chatLink}/#/?settings={"key":"sk-${key}","url":"${encodeURIComponent(serverAddress)}"}`; }; const iframeSrc = keys.length > 0 ? comLink(keys[0]) : ''; return !isLoading && iframeSrc ? ( ) : (