plebdevs/src/components/zaps/ZapDisplay.js

23 lines
714 B
JavaScript
Raw Normal View History

2024-04-22 19:09:46 -05:00
import React, { useRef } from 'react';
import { OverlayPanel } from 'primereact/overlaypanel';
import ZapForm from './ZapForm';
2024-04-23 21:30:54 -05:00
import { ProgressSpinner } from 'primereact/progressspinner';
2024-04-22 19:09:46 -05:00
const ZapDisplay = ({ zapAmount, event }) => {
const op = useRef(null);
return (
<>
<p className="text-xs cursor-pointer" onClick={(e) => op.current.toggle(e)}>
2024-04-23 21:30:54 -05:00
<i className="pi pi-bolt text-yellow-300"></i>
{zapAmount ? zapAmount : <ProgressSpinner />}
2024-04-22 19:09:46 -05:00
</p>
<OverlayPanel className='w-[40%] h-[40%]' ref={op}>
2024-04-22 19:09:46 -05:00
<ZapForm event={event} />
</OverlayPanel>
</>
)
}
export default ZapDisplay;