import { __ } from '@wordpress/i18n'; import type { JSX } from 'react'; import { brokenLinkOptions, type BrokenLinkChoice } from './brokenLinkOptions'; const CHOICE_GROUP_NAME = 'lcu-how'; const ALL_ADDRESS_FIELD_ID = 'lcu-all-url'; type BrokenLinkChoicesProps = { choice: BrokenLinkChoice; address: string; onChoose: ( choice: BrokenLinkChoice ) => void; onAddressChange: ( address: string ) => void; }; export function BrokenLinkChoices( { choice, address, onChoose, onAddressChange, }: BrokenLinkChoicesProps ): JSX.Element { return ( <>
{ __( 'What should happen to the broken links', 'aiplaz-link-checkup' ) } { brokenLinkOptions().map( ( option ) => ( ) ) }
{ choice === 'replace' && (
{ onAddressChange( event.target.value ); } } />
) } ); }