export function formatTrainStatusMessage(
	reason: string | undefined,
	location: string | undefined,
	near: boolean | undefined
) {
	let output = '';
	if (reason) {
		output += reason.trim();
	}

	if (location) {
		const preposition = near ? 'near' : 'at';
		output += ` ${preposition} ${location}`;
	}

	return output.trim();
}
