import React, { useEffect, useRef } from 'react';
const ZapThreadsWrapper = ({ anchor, user, relays, disable, className, isAuthorized }) => {
// Create a ref to store the reference to the
element
const zapRef = useRef(null);
useEffect(() => {
// Only load the script if the user is authorized
if (!isAuthorized) {
return;
}
// Store the current value of zapRef to use in the cleanup function
const currentZapRef = zapRef.current;
// Create a new