import {Field, FormTable, Header, Nonce, Row} from './form' import {__, sprintf, _n} from '@wordpress/i18n' import {ChangeEvent, useState} from 'react' declare global { const nmEditMapRef: { data: RefData nonce: string post_id: string } } type BaseData = { post_id: number post_status: 'publish' | 'private' title: string } type RefData = { locations: { [key: number]: { address: string } & BaseData } maps: ({ locations: number[] } & BaseData)[] selected: number } type Props = { data: RefData nonce: string postId: string } export default function EditMapRef(props: Props) { const { data: { locations, maps, }, nonce, } = props const [selected, setSelected] = useState(props.data.selected) return ( <>
{/* Nonce is here! */} ) }