PHP Classes

File: src/components/jobs/SelectCheckBox.tsx

Recommend this page to a friend!
  Classes of Maniruzzaman Akash   WordPress React Plugin Kit   src/components/jobs/SelectCheckBox.tsx   Download  
File: src/components/jobs/SelectCheckBox.tsx
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: WordPress React Plugin Kit
Environment to develop new WordPress plugins
Author: By
Last change:
Date: 1 year ago
Size: 1,237 bytes
 

Contents

Class file image Download
/** * External dependencies. */ import { useState } from '@wordpress/element'; import { toast } from 'react-toastify'; import { __ } from '@wordpress/i18n'; /** * Internal dependencies. */ import SelectListItem from '../page-partials/SelectListItem'; import SelectedItem from '../page-partials/SelectedItem'; type Props = { checked: number[]; onChange: (checked: number[]) => void; }; export default function SelectCheckBox({ checked }: Props) { const [action, setAction] = useState(''); const applyActionLoading = false; const handleApplyAction = () => { if (action === '') { toast.warning(__('Please select an action.', 'jobplace')); return; } if (action === 'delete') { // dispatch(deleteEmailTemplateAction(checked)); } // finally clear the action setAction(''); }; return ( <div className="bg-white p-3"> <SelectListItem action={action} setAction={setAction} applyActionLoading={applyActionLoading} handleApplyAction={handleApplyAction} /> <SelectedItem checked={checked} /> </div> ); }