| 1 |
import React from 'react' |
| 2 |
import { __ } from '@wordpress/i18n' |
| 3 |
import { useSnippetForm } from '../../../hooks/useSnippetForm' |
| 4 |
|
| 5 |
export const MultisiteSharingSettings: React.FC = () => { |
| 6 |
const { snippet, setSnippet, isReadOnly } = useSnippetForm() |
| 7 |
|
| 8 |
return <> |
| 9 |
<h2 className="screen-reader-text">{__('Sharing Settings', 'code-snippets')}</h2> |
| 10 |
<p className="snippet-sharing-setting"> |
| 11 |
<label htmlFor="snippet_sharing"> |
| 12 |
<input |
| 13 |
id="snippet_sharing" |
| 14 |
name="snippet_sharing" |
| 15 |
type="checkbox" |
| 16 |
checked={Boolean(snippet.shared_network)} |
| 17 |
disabled={isReadOnly} |
| 18 |
onChange={event => |
| 19 |
setSnippet(previous => ({ ...previous, shared_network: event.target.checked }))} |
| 20 |
/> |
| 21 |
{__('Allow this snippet to be activated on individual sites on the network', 'code-snippets')} |
| 22 |
</label> |
| 23 |
</p> |
| 24 |
</> |
| 25 |
} |
| 26 |
|