import { __ } from '@wordpress/i18n';
import { useBlockProps, InspectorControls } from '@wordpress/block-editor';
import { PanelBody, TextControl, ToggleControl, SelectControl, CheckboxControl } from '@wordpress/components';
import { useEffect, useState } from '@wordpress/element';
import apiFetch from '@wordpress/api-fetch';
import './editor.scss';
export default function Edit({ attributes, setAttributes }) {
const blockProps = useBlockProps();
const [availableTypes, setAvailableTypes] = useState({});
useEffect(() => {
apiFetch({ path: '/jvb/v1/types' }).then(types => {
setAvailableTypes(JSON.parse(types));
});
}, []);
return (
<>
{__('Content Types', 'jvb')}