Skip to content

Commit

Permalink
feat: 🎸 Add loader to iframe widget
Browse files Browse the repository at this point in the history
  • Loading branch information
gmpetrov committed Oct 12, 2023
1 parent 6912835 commit c60801d
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion apps/dashboard/components/ChatBoxFrame.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Box from '@mui/joy/Box';
import CircularProgress from '@mui/joy/CircularProgress';
import { useColorScheme } from '@mui/joy/styles';
import { useRouter } from 'next/router';
import React, { useEffect, useMemo } from 'react';
Expand Down Expand Up @@ -106,7 +107,20 @@ function ChatBoxFrame(props: { initConfig?: AgentInterfaceConfig }) {
// }, []);

if (!agent) {
return null;
return (
<Box
sx={{
width: '100dvw',
height: '100dvh',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
background: 'transparent',
}}
>
<CircularProgress size="sm" variant="soft" color="neutral" />
</Box>
);
}

return (
Expand Down

1 comment on commit c60801d

@vercel
Copy link

@vercel vercel bot commented on c60801d Oct 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.