/var/www/vhosts/ihelp.ro/ajutam.ro/wp-content/plugins/give/blocks/components/select-form
Edit: /var/www/vhosts/ihelp.ro/ajutam.ro/wp-content/plugins/give/blocks/components/select-form/index.js (1175B)
/**
* WordPress dependencies
*/
const { __ } = wp.i18n;
const { withSelect } = wp.data;
const { Placeholder, Spinner } = wp.components;
/**
* Internal dependencies
*/
import './index.scss';
import GiveBlankSlate from '../blank-slate';
import NoForms from '../no-form';
import ChosenSelect from '../chosen-select';
import { getFormOptions } from '../../utils';
const SelectForm = ( { forms, setAttributes } ) => {
const setFormIdTo = id => {
setAttributes( { id: Number( id ) } );
};
// Render Component UI
let componentUI;
if ( ! forms ) {
componentUI =
;
} else if ( forms && forms.length === 0 ) {
componentUI =
;
} else {
componentUI = (
);
}
return componentUI;
};
/**
* Export with forms data
*/
export default withSelect( ( select ) => {
return {
forms: select( 'core' ).getEntityRecords( 'postType', 'give_forms', { per_page: 30 } ),
};
} )( SelectForm );