| 1 |
import { __ } from '@wordpress/i18n'; |
| 2 |
|
| 3 |
export const Generic = ({ inputs, onConfirm, onCancel }) => { |
| 4 |
const run = () => onConfirm?.({ data: inputs ?? {} }); |
| 5 |
|
| 6 |
return ( |
| 7 |
<div className="mb-4 ms-2 me-2 flex flex-col rounded-lg border border-gray-300 bg-gray-50"> |
| 8 |
<div className="rounded-lg border-b border-gray-300 bg-white p-3"> |
| 9 |
<p className="m-0 p-0 text-sm text-gray-900"> |
| 10 |
{ |
| 11 |
// translators: confirm prompt before the agent performs a WordPress task it picked. |
| 12 |
__('Run this action?', 'extendify-local') |
| 13 |
} |
| 14 |
</p> |
| 15 |
</div> |
| 16 |
<div className="flex justify-start gap-2 p-3"> |
| 17 |
<button |
| 18 |
type="button" |
| 19 |
className="w-full rounded-sm border border-gray-500 bg-white p-2 text-sm text-gray-900" |
| 20 |
onClick={onCancel} |
| 21 |
> |
| 22 |
{__('Cancel', 'extendify-local')} |
| 23 |
</button> |
| 24 |
<button |
| 25 |
type="button" |
| 26 |
className="w-full rounded-sm border border-design-main bg-design-main p-2 text-sm text-white" |
| 27 |
onClick={run} |
| 28 |
> |
| 29 |
{__('Confirm', 'extendify-local')} |
| 30 |
</button> |
| 31 |
</div> |
| 32 |
</div> |
| 33 |
); |
| 34 |
}; |
| 35 |
|