/** * JavaScript code for the "List of Tables Screen" component. * * @package TablePress * @subpackage List of Tables Screen * @author Tobias Bäthge * @since 3.1.0 */ /** * WordPress dependencies. */ import { useCallback, useEffect, useRef, useState } from 'react'; import { Button, Icon, __experimentalHStack as HStack, // eslint-disable-line @wordpress/no-unsafe-wp-apis __experimentalInputControl as InputControl, // eslint-disable-line @wordpress/no-unsafe-wp-apis __experimentalInputControlSuffixWrapper as InputControlSuffixWrapper, // eslint-disable-line @wordpress/no-unsafe-wp-apis Modal, __experimentalVStack as VStack, // eslint-disable-line @wordpress/no-unsafe-wp-apis } from '@wordpress/components'; import { useCopyToClipboard } from '@wordpress/compose'; import { useDispatch } from '@wordpress/data'; import { copySmall, external } from '@wordpress/icons'; import { __, _n } from '@wordpress/i18n'; import { store as noticesStore } from '@wordpress/notices'; /** * Internal dependencies. */ import { TablePressIcon, TablePressIconSimple } from '../../img/tablepress-icon'; import { Notifications } from '../common/notifications'; /** * Returns the Table Preview component's JSX markup. * * @param {Object} props Component props. * @param {string} props.title Title of the preview. * @param {string} props.url URL of the preview. * @param {Function} props.onRequestClose Callback to close the preview. * @return {Object} Table Preview component. */ const TablePreview = ( { title, url, onRequestClose } ) => { return ( } title={ title } className="table-preview-modal" onRequestClose={ onRequestClose } size="fill" headerActions={