import * as React from 'react' import {__, _x} from '@wordpress/i18n' import { Fragment, } from '@wordpress/element' import { __experimentalNavigatorScreen as NavigatorScreen, } from '@wordpress/components' import { sanitizeURIComponent, } from '@ska/utils' import { ApplyTailwindContext, } from '../../../tailwind' import type { tBlockAttributes, tBlockEditProps, } from '@ska/shared' import { SelectorEdit, } from '.' export interface SelectorScreensProps { root?: string attributes: tBlockAttributes setAttributes: tBlockEditProps['setAttributes'] } const SelectorScreens: React.FC = ({ root = '/selector', attributes, setAttributes, }) => { const { skaBlocksSelectors = {}, } = attributes const selectors = Object.keys(skaBlocksSelectors) return ( {selectors.map(selector => { return ( { setAttributes({ ...attributes, skaBlocksSelectors: { ...skaBlocksSelectors, [selector]: { ...skaBlocksSelectors[selector], ...nextAttributes, }, }, }) }} /> ) })} ) } export default SelectorScreens