import $ from 'jquery';
import { isOrderView } from './isOrderView';
import { close_modal } from './close_modal';

export const handle_edit_order_link_click = (event: JQuery.ClickEvent) => {
	event.preventDefault();

	const order_id = $(event.currentTarget).attr('href') as string;

	if (isOrderView()) {
		close_modal();
	} else {
		window.location.assign( order_id );
	}
};
