# extendify/3.2.1/src/AutoLaunch/hooks/useMigrateChoice.js

Extendify, version 3.2.1. 47 lines.

- Page: https://pluginprobe.com/plugins/extendify/3.2.1/code/src/AutoLaunch/hooks/useMigrateChoice.js
- Raw: https://pluginprobe.com/plugins/extendify/3.2.1/raw/src/AutoLaunch/hooks/useMigrateChoice.js
- Modified: 2026-09-09T18:23:40+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/extendify/3.2.1/code/src/AutoLaunch/hooks/useMigrateChoice.js#L10-L20`.

```javascript
import { checkIn } from '@auto-launch/functions/insights';
import { sparkles } from '@auto-launch/icons';
import { launchStrings } from '@auto-launch/strings';
import { useEffect } from '@wordpress/element';
import { cloudUpload } from '@wordpress/icons';

const migrateSearchUrl = (search) =>
	`${window.extSharedData.adminUrl}plugin-install.php?tab=search&s=${encodeURIComponent(search)}`;

export const useMigrateChoice = ({ onBuildNew }) => {
	const strings = launchStrings();

	useEffect(() => {
		checkIn({ stage: 'migrate_screen' });
	}, []);

	return {
		title: strings.migrateTitle,
		options: [
			{
				key: 'migrate',
				icon: cloudUpload,
				heading: strings.migrateHeading,
				buttonLabel: strings.migrateAction,
				description: strings.migrateBody,
				onClick: () => {
					checkIn({ stage: 'migrate_screen_migrate' });
					window.location.assign(migrateSearchUrl(strings.migrationSearch));
				},
			},
			{
				key: 'build',
				icon: sparkles,
				heading: strings.buildHeading,
				highlight: true,
				badgeLabel: strings.buildBadge,
				buttonLabel: strings.buildAction,
				description: strings.buildBody,
				onClick: () => {
					checkIn({ stage: 'migrate_screen_build' });
					onBuildNew();
				},
			},
		],
	};
};

```
