import {__} from '@wordpress/i18n'; import {createInterpolateElement} from '@wordpress/element'; import styles from './DonationFormsSection.module.scss'; import SectionTable from '../SectionTable'; import {useState} from 'react'; /** * Displays a blank slate for the Donation Forms table. * * @since 3.6.0 */ const BlankSlate = () => { const helpMessage = createInterpolateElement( __( 'To link an event to a donation form, add an event block to a donation form in the visual form builder.', 'give' ), { a: , } ); return (

{__('No linked form yet', 'give')}

{helpMessage}

); }; /** * @since 3.6.0 */ export default function DonationFormsSection() { const { adminUrl, event: {forms}, } = window.GiveEventTicketsDetails; const [data, setData] = useState(forms); const tableHeaders = { id: __('ID', 'give'), title: __('Name', 'give'), }; const formattedData = data.map((form) => { return { id: form.id, title:
{form.title}, }; }); return (

{__('Donation Forms', 'give')}

} />
); }