import { __ } from '@wordpress/i18n';
import type { Problem } from '../../shared/links/problem';

export function whyText( problem: Problem ): string {
	switch ( problem ) {
		case 'blocked':
			return __(
				'We could not tell if this link works. Open it yourself, then tell us.',
				'aiplaz-link-checkup'
			);
		case 'moved':
			return __(
				'The link still works, but it sends visitors on a detour. Updating it is quicker for them.',
				'aiplaz-link-checkup'
			);
		case 'broken':
			return __(
				'Visitors who click this link see an error page.',
				'aiplaz-link-checkup'
			);
	}
}

export function sinceLabel( problem: Problem ): string {
	switch ( problem ) {
		case 'blocked':
			return __( 'Blocked since', 'aiplaz-link-checkup' );
		case 'moved':
			return __( 'Redirecting since', 'aiplaz-link-checkup' );
		case 'broken':
			return __( 'Failing since', 'aiplaz-link-checkup' );
	}
}

export function stillText( problem: Problem ): string {
	switch ( problem ) {
		case 'blocked':
			return __(
				'Checked just now. Still blocked.',
				'aiplaz-link-checkup'
			);
		case 'moved':
			return __(
				'Checked just now. Still redirects.',
				'aiplaz-link-checkup'
			);
		case 'broken':
			return __(
				'Checked just now. Still broken.',
				'aiplaz-link-checkup'
			);
	}
}
