plebdevs/src/components/zaps/ZapDisplay.js

26 lines
845 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 (
<>
2024-07-31 16:41:18 -05:00
<span className="text-xs cursor-pointer" onClick={(e) => op.current.toggle(e)}>
<i className="pi pi-bolt text-yellow-300"></i>
{zapAmount || zapAmount === 0 ? (
zapAmount
) : (
<ProgressSpinner style={{ display: 'inline-block' }} />
)}
</span>
<OverlayPanel className='w-[40%] h-[40%]' ref={op}>
2024-04-22 19:09:46 -05:00
<ZapForm event={event} />
</OverlayPanel>
</>
)
}
2024-07-31 16:41:18 -05:00
export default ZapDisplay;