/**
* Settings › Privacy, Your data: export everything Mailpuff holds as one
* JSON file, and import such a file on another site. Two rows, each a label,
* a `?` and its button; deleting everything is the row after them
* (./DangerBlock.jsx).
*/
import { useRef, useState } from '@wordpress/element';
import { __, sprintf } from '@wordpress/i18n';
import { useUi } from '../../runtime';
import { apiGet, apiPost } from '../../api/client';
import { errorText } from '../../lib/format';
/**
* A row that acts at once: its name and `?` on the left, its button on the
* right. Rows sit in a `ToggleList`, which draws the hairlines.
*
* @param {Object} props
* @param {*} props.label What the row does.
* @param {*} props.tip Optional help.
* @param {*} props.children The button.
* @return {Element} The row.
*/
export function ActionRow( { label, tip, children } ) {
const { ui } = useUi();
return (