2026-06-25 11:49:59 +00:00
|
|
|
import { useUrlParamId } from "@erp/core/hooks";
|
|
|
|
|
import { useSearchParams } from "react-router-dom";
|
|
|
|
|
|
2026-03-10 17:10:11 +00:00
|
|
|
import { useCustomerViewController } from "./use-customer-view.controller";
|
|
|
|
|
|
|
|
|
|
export function useCustomerViewPageController() {
|
2026-06-25 11:49:59 +00:00
|
|
|
const customerId = useUrlParamId();
|
|
|
|
|
const [searchParams] = useSearchParams();
|
|
|
|
|
|
|
|
|
|
const viewCtrl = useCustomerViewController(customerId);
|
|
|
|
|
|
|
|
|
|
const returnTo = searchParams.get("returnTo") ?? "/customers";
|
2026-03-10 17:10:11 +00:00
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
viewCtrl,
|
2026-06-25 11:49:59 +00:00
|
|
|
returnTo,
|
2026-03-10 17:10:11 +00:00
|
|
|
};
|
|
|
|
|
}
|