import ConnectSite from '@/features/connection/ConnectSite';
import { getWordPressConfig } from '@/api/client';

/**
 * Connect Step
 *
 * The one permission Flavio asks for before it touches the site: explicit
 * consent to create the WordPress Application Password. Sits right before the
 * tagline steps because those are the first ones that need the credential
 * (reading the current tagline, writing the new one). The step is left out of
 * the flow when the site is already connected (see OnboardingPage).
 *
 * The screen itself lives in ConnectSite, shared with the post-onboarding
 * reconnection gate in App.jsx; this wrapper only wires it into the wizard.
 */
const Connect = ({ onNext }) => {
	const { connection } = getWordPressConfig();
	return (
		<ConnectSite
			connection={connection}
			onConnected={() => onNext({ connected: true })}
		/>
	);
};

export default Connect;
