import { memo, useState } from 'react' import { InfoBlock } from '../info-block' import { useWebsiteContext } from '@app/components/providers/website' import { checkBoxStyle } from '@app/styles/checkbox' export const RobotsBoxWrapper = ({ robots, url, }: { robots?: boolean url?: string }) => { const [robotsEnabled, setTLD] = useState(!!robots) const { updateWebsite } = useWebsiteContext() const onChangeEvent = async () => { let nextValue = !robotsEnabled setTLD(nextValue) try { await updateWebsite({ variables: { url, robots: nextValue }, }) } catch (e) { console.error(e) } } const labelId = `${url}-robots-form` return (
{robotsEnabled ? 'Enabled' : 'Disabled'}
) } export const RobotsBox = memo(RobotsBoxWrapper)