import React, { memo, useState } from 'react' import { InfoBlock } from '../info-block' import { useWebsiteContext } from '@app/components/providers/website' export const MobileBoxWrapper = ({ mobile, url, }: { mobile?: boolean url?: string }) => { const [isMobile, setMobile] = useState(!!mobile) const { updateWebsite } = useWebsiteContext() const onMobileEvent = async () => { let nextValue = !isMobile setMobile(nextValue) try { await updateWebsite({ variables: { url, mobile: nextValue }, }) } catch (e) { console.error(e) } } const labelId = `${url}-mobile-form` return (
{isMobile ? 'Mobile Viewport' : 'Web Viewport'}
) } export const MobileBox = memo(MobileBoxWrapper)