import * as React from 'react' import {__, _x, sprintf} from '@wordpress/i18n' import { Button, __experimentalNumberControl as NumberControl, } from '@wordpress/components' import { shuffle as shuffleIcon, seen as seenIcon, } from '@wordpress/icons' import { getPlaceholderSvg, } from '@ska/shared' import { maxPlaceholderImage, placeholderImageUrl, } from '../../data' import { usePluginPreference, } from '../../store' import './style.scss' export interface PlaceholderImageControlProps { value: number onChange: (nextValue: number) => void showPlaceholderImageToggle?: boolean } const PlaceholderImageControl: React.FC = ({ value, onChange, showPlaceholderImageToggle = false, }) => { const [showPlaceholderImage, setShowPlaceholderImage] = usePluginPreference('showPlaceholderImage') if(!placeholderImageUrl) { return null } return (
onChange(parseInt(nextValue || '0'))} suffix={<>
) } export default PlaceholderImageControl