MCPcopy Create free account
hub / github.com/TornadoInsight/Sora-FullStack / LoadingModal

Function LoadingModal

src/components/LoadingModal.tsx:5–72  ·  view source on GitHub ↗
({loadingText})

Source from the content-addressed store, hash-verified

3import {useCommonContext} from '@/context/common-context'
4
5export default function LoadingModal({loadingText}) {
6 const cancelButtonRef = useRef(null)
7 const {showLoadingModal, setShowLoadingModal} = useCommonContext()
8
9 return (
10 <Transition.Root
11 show={showLoadingModal}
12 as={Fragment}>
13 <Dialog
14 as='div'
15 className='relative z-30'
16 initialFocus={cancelButtonRef}
17 onClose={setShowLoadingModal}>
18 <Transition.Child
19 as={Fragment}
20 enter='ease-out duration-300'
21 enterFrom='opacity-0'
22 enterTo='opacity-100'
23 leave='ease-in duration-200'
24 leaveFrom='opacity-100'
25 leaveTo='opacity-0'>
26 <div className='fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity' />
27 </Transition.Child>
28
29 <div className='fixed inset-0 z-30 overflow-y-auto'>
30 <div className='flex min-h-full items-center justify-center p-4 text-center'>
31 <Transition.Child
32 as={Fragment}
33 enter='ease-out duration-300'
34 enterFrom='opacity-0 translate-y-4'
35 enterTo='opacity-100 translate-y-0'
36 leave='ease-in duration-200'
37 leaveFrom='opacity-100 translate-y-0'
38 leaveTo='opacity-0 translate-y-4'>
39 <Dialog.Panel className='relative transform overflow-hidden rounded-lg bg-white text-left shadow-xl'>
40 <div className='flex items-center justify-center'>
41 <div
42 className='inline-flex items-center px-4 py-2 text-xl font-semibold leading-6 transition duration-150 ease-in-out'
43 style={{color: '#2d6ae0'}}>
44 <svg
45 className='-ml-1 mr-3 h-10 w-10 animate-spin'
46 style={{color: '#2d6ae0'}}
47 xmlns='http://www.w3.org/2000/svg'
48 fill='none'
49 viewBox='0 0 24 24'>
50 <circle
51 className='opacity-25'
52 cx='12'
53 cy='12'
54 r='10'
55 stroke='currentColor'
56 strokeWidth='4'></circle>
57 <path
58 className='opacity-75'
59 fill='currentColor'
60 d='M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z'></path>
61 </svg>
62 {loadingText}

Callers

nothing calls this directly

Calls 1

useCommonContextFunction · 0.90

Tested by

no test coverage detected