import { memo, useCallback } from 'react' import { useWebsiteContext } from '@app/components/providers/website' import { btnStyles, MoreOptionsBase, MoreOptionsProps } from './more-base' import { Link } from '@app/components/stateless/typo/link' import { Menu } from '@headlessui/react' import { useAuthContext } from '@app/components/providers/auth' import { GrLock } from 'react-icons/gr' import { classNames } from '@app/utils/classes' function MoreOptionsComponent(props: MoreOptionsProps) { const { updateWebsite } = useWebsiteContext() const { account } = useAuthContext() const { url, removePress, historyPage, crawlWebsite, pageHeaders, index, handleMainClick, pageInsights, shutdown, verified, } = props const toggleLighthouse = useCallback(async () => { try { await updateWebsite({ variables: { url, pageInsights: !pageInsights } }) } catch (e) { console.error(e) } }, [updateWebsite, url, pageInsights]) return ( {!historyPage ? ( <> {() => ( )} {typeof crawlWebsite === 'function' ? ( {() => ( )} ) : null} {() => ( )} {() => ( )} ) : null} {!verified && !historyPage ? ( {() => ( )} ) : null} {shutdown ? ( {() => ( Upgrade )} ) : null} {typeof removePress === 'function' && !historyPage ? (
{() => ( )}
) : null}
) } export const MoreOptions = memo(MoreOptionsComponent)